You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having an odd bug which I have been able to reproduce. If I enable Option::AUTO_IMPORT_NAMES, then enable the sets DowngradeTypedPropertyRector and DowngradeMixedTypeDeclarationRector, function arguments with the same type declaration as a property will be stripped of their typed declaration, and an @param will be added with type mixed.
…deMixedTypeDeclarationRector Name parameter (#591)
* Demonstrate issue with DowngradeMixedTypeDeclarationRector
* Closes#590Fixesrectorphp/rector#6611
* final touch: better check as already FullyQualified no need convert
* final touch: clean up
Co-authored-by: Brandon Olivares <programmer2188@gmail.com>
Bug Report
I'm having an odd bug which I have been able to reproduce. If I enable Option::AUTO_IMPORT_NAMES, then enable the sets DowngradeTypedPropertyRector and DowngradeMixedTypeDeclarationRector, function arguments with the same type declaration as a property will be stripped of their typed declaration, and an
@param
will be added with typemixed
.See code example for more clarity.
Minimal PHP Code Causing Issue
In
test.php
:In
rector.php
:Running command:
vendor/bin/rector process test.php
Gives output:
Expected Behaviour
It should strip the property of its type declaration, but not the function argument.
So the output should be:
The text was updated successfully, but these errors were encountered: