Modernizer: add scalar + return type declarations (wherever possible) #241
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In line with the new minimum of PHPUnit 7.x, the assertions in the PHPUnit Polyfills will now have both parameter as well as return type declarations (wherever possible considering the minimum supported PHP version of PHP 7.1).
Additional type declarations will be added in future majors if/when the minimum supported PHP version allows for it.
Includes removing polyfilled inline type checks for assertions which were introduced in PHPUnit with declared types, but for which the polyfills couldn't type the parameters prior to this.
Includes minor adjustments to exception expectations in the tests to allow for the PHP native
TypeError
s - in contrast to the emulated ones.Notes:
AssertObjectProperty
: thestring
type for the$propertyName
parameter for theassertObject[Not]HasProperty()
has not been applied as it would invalidate the type check (as we can't enforcestrict_types
for tests using the assertion).Refs: