-
-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Php80] Add AddParamBasedOnParentClassMethodRector #1431
Conversation
if (count($currentClassMethodParams) < count($parentClassMethodParams)) { | ||
$node->params = $parentClassMethodParams; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replacing current classmethod params with parent classmethod params seems got error:
There was 1 failure:
1) Rector\Tests\Php80\Rector\ClassMethod\AddParamBasedOnParentClassMethodRector\AddParamBasedOnParentClassMethodRectorTest::test with data set #0 (Symplify\SmartFileSystem\SmartFileInfo Object (...))
assert($startPos >= 0 && $endPos >= 0) in /Users/samsonasik/www/rector-src/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php:535
need to find different solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by loop parent params and re-create params with new Variable with empty attributes 4b3bec8
/cc @norgeindian |
All checks have passed 🎉 @TomasVotruba it is ready for review. |
… Closure for parent to check scope
* main: (50 commits) Add SimpleStaticType for return type completion (rectorphp#1441) [Transform] Move ReservedFnFunctionRector from Php74 to Transform namespace (rectorphp#1423) [Php80] Add AddParamBasedOnParentClassMethodRector (rectorphp#1431) [DowngradePhp80] Add DowngradeRecursiveDirectoryIteratorHasChildrenRector (rectorphp#1440) [Scoped] Skip symfony console Event and EventListener and exclude in parallel-lint (rectorphp#1439) [Scoped] Fix exclude symfony/console/Tester (rectorphp#1438) [Scoped] Require symfony-eventdispatcher on build (rectorphp#1437) [Scoped] Fix downgrade error on symfony/console/Tester (rectorphp#1436) [Scoped] Fix downgrade error on symfony/Event* (rectorphp#1435) [TypeDeclaration][Php 8.1] Add Closure support to ReturnNeverTypeRector (rectorphp#1434) [composer] require own rector packages in dev-main, to avoid endless tagging (rectorphp#1433) [TypeDeclaration][Php 8.1] Do not change parent function to never on ReturnNeverTypeRector (rectorphp#1432) [DX] Improve configuration objects + allow Symfony 6 (rectorphp#1430) Require Symplify 10.0.2, remove stringy deprecated package from installed dependencies 🎉 (rectorphp#1429) Bump to Symplify 10.0.1 stable (rectorphp#1428) [DX] Decouple AssignVariableNameResolver (rectorphp#1427) [DowngradePhp80] Fix DowngradeThrowExprRector on property fetch to use not isset (rectorphp#1426) [DX] Replace deprecated danielstjules/stringy with Symfony\String (rectorphp#1425) [Alternative][Validation] Add AllowEmptyConfigurableRectorInterface interface for alternative to not show warning on allowed rector rule to have default fallback config (rectorphp#1422) [DX] Less addNodeAfterNode() methods (rectorphp#1421) ...
Fixes rectorphp/rector#6851