This repository has been archived by the owner on Dec 3, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 190
Fix rector.php config PreferenceSelfThis enum usage #3375
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
samsonasik
commented
Jun 30, 2021
samsonasik
commented
Jun 30, 2021
@TomasVotruba it got another error on running PHPStan: In NodeTypeResolver.php line 129:
Look at "Rector\NodeTypeResolver\NodeTypeResolver::isObjectType()" on line Stack trace: [applying] Rector\Php70\Rector\FuncCall\NonVariableToVariableOnFunctionCallRector
PHP Fatal error: Uncaught PHPStan\ShouldNotHappenException: Internal error. in phar:///Users/samsonasik/www/symplify/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ParametersAcceptorSelector.php:23
Stack trace:
#0 /Users/samsonasik/www/symplify/vendor/rector/rector/rules/Php70/Rector/FuncCall/NonVariableToVariableOnFunctionCallRector.php(108): PHPStan\Reflection\ParametersAcceptorSelector::selectSingle(Array)
#1 /Users/samsonasik/www/symplify/vendor/rector/rector/rules/Php70/Rector/FuncCall/NonVariableToVariableOnFunctionCallRector.php(73): Rector\Php70\Rector\FuncCall\NonVariableToVariableOnFunctionCallRector->getNonVariableArguments(Object(PhpParser\Node\Expr\FuncCall))
#2 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Rector/AbstractRector.php(254): Rector\Php70\Rector\FuncCall\NonVariableToVariableOnFunctionCallRector->refactor(Object(PhpParser\Node\Expr\FuncCall))
#3 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(113): Rector\Core\Rector\AbstractRector->enterNode(Object(PhpParser\Node\Expr\FuncCall))
#4 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(133): PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Expr\Assign))
#5 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196): PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Stmt\Expression))
#6 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105): PhpParser\NodeTraverser->traverseArray(Array)
#7 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196): PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Stmt\ClassMethod))
#8 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105): PhpParser\NodeTraverser->traverseArray(Array)
#9 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196): PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Stmt\Class_))
#10 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105): PhpParser\NodeTraverser->traverseArray(Array)
#11 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196): PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Stmt\Namespace_))
#12 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(85): PhpParser\NodeTraverser->traverseArray(Array)
#13 /Users/samsonasik/www/symplify/vendor/rector/rector/src/PhpParser/NodeTraverser/RectorNodeTraverser.php(46): PhpParser\NodeTraverser->traverse(Array)
#14 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Application/FileProcessor.php(53): Rector\Core\PhpParser\NodeTraverser\RectorNodeTraverser->traverse(Array)
#15 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(162): Rector\Core\Application\FileProcessor->refactor(Object(Rector\Core\ValueObject\Application\File))
#16 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(175): Rector\Core\Application\FileProcessor\PhpFileProcessor->Rector\Core\Application\FileProcessor\{closure}(Object(Rector\Core\ValueObject\Application\File))
#17 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(161): Rector\Core\Application\FileProcessor\PhpFileProcessor->tryCatchWrapper(Object(Rector\Core\ValueObject\Application\File), Object(Closure), 'refactoring', Object(Rector\Core\ValueObject\Configuration))
#18 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(106): Rector\Core\Application\FileProcessor\PhpFileProcessor->refactorNodesWithRectors(Array, Object(Rector\Core\ValueObject\Configuration))
#19 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Application/ApplicationFileProcessor.php(65): Rector\Core\Application\FileProcessor\PhpFileProcessor->process(Array, Object(Rector\Core\ValueObject\Configuration))
#20 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Application/ApplicationFileProcessor.php(51): Rector\Core\Application\ApplicationFileProcessor->processFiles(Array, Object(Rector\Core\ValueObject\Configuration))
#21 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Console/Command/ProcessCommand.php(121): Rector\Core\Application\ApplicationFileProcessor->run(Array, Object(Rector\Core\ValueObject\Configuration))
#22 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/symfony/console/Command/Command.php(262): Rector\Core\Console\Command\ProcessCommand->execute(Object(RectorPrefix20210630\Symfony\Component\Console\Input\ArgvInput), Object(RectorPrefix20210630\Symfony\Component\Console\Output\ConsoleOutput))
#23 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/symfony/console/Application.php(828): RectorPrefix20210630\Symfony\Component\Console\Command\Command->run(Object(RectorPrefix20210630\Symfony\Component\Console\Input\ArgvInput), Object(RectorPrefix20210630\Symfony\Component\Console\Output\ConsoleOutput))
#24 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/symfony/console/Application.php(255): RectorPrefix20210630\Symfony\Component\Console\Application->doRunCommand(Object(Rector\Core\Console\Command\ProcessCommand), Object(RectorPrefix20210630\Symfony\Component\Console\Input\ArgvInput), Object(RectorPrefix20210630\Symfony\Component\Console\Output\ConsoleOutput))
#25 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Console/ConsoleApplication.php(67): RectorPrefix20210630\Symfony\Component\Console\Application->doRun(Object(RectorPrefix20210630\Symfony\Component\Console\Input\ArgvInput), Object(RectorPrefix20210630\Symfony\Component\Console\Output\ConsoleOutput))
#26 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/symfony/console/Application.php(153): Rector\Core\Console\ConsoleApplication->doRun(Object(RectorPrefix20210630\Symfony\Component\Console\Input\ArgvInput), Object(RectorPrefix20210630\Symfony\Component\Console\Output\ConsoleOutput))
#27 /Users/samsonasik/www/symplify/vendor/rector/rector/bin/rector.php(47): RectorPrefix20210630\Symfony\Component\Console\Application->run()
#28 /Users/samsonasik/www/symplify/vendor/rector/rector/bin/rector(5): require_once('/Users/samsonas...')
#29 {main}
thrown in phar:///Users/samsonasik/www/symplify/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ParametersAcceptorSelector.php on line 23
Fatal error: Uncaught PHPStan\ShouldNotHappenException: Internal error. in phar:///Users/samsonasik/www/symplify/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ParametersAcceptorSelector.php:23
Stack trace:
#0 /Users/samsonasik/www/symplify/vendor/rector/rector/rules/Php70/Rector/FuncCall/NonVariableToVariableOnFunctionCallRector.php(108): PHPStan\Reflection\ParametersAcceptorSelector::selectSingle(Array)
#1 /Users/samsonasik/www/symplify/vendor/rector/rector/rules/Php70/Rector/FuncCall/NonVariableToVariableOnFunctionCallRector.php(73): Rector\Php70\Rector\FuncCall\NonVariableToVariableOnFunctionCallRector->getNonVariableArguments(Object(PhpParser\Node\Expr\FuncCall))
#2 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Rector/AbstractRector.php(254): Rector\Php70\Rector\FuncCall\NonVariableToVariableOnFunctionCallRector->refactor(Object(PhpParser\Node\Expr\FuncCall))
#3 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(113): Rector\Core\Rector\AbstractRector->enterNode(Object(PhpParser\Node\Expr\FuncCall))
#4 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(133): PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Expr\Assign))
#5 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196): PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Stmt\Expression))
#6 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105): PhpParser\NodeTraverser->traverseArray(Array)
#7 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196): PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Stmt\ClassMethod))
#8 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105): PhpParser\NodeTraverser->traverseArray(Array)
#9 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196): PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Stmt\Class_))
#10 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105): PhpParser\NodeTraverser->traverseArray(Array)
#11 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196): PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Stmt\Namespace_))
#12 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(85): PhpParser\NodeTraverser->traverseArray(Array)
#13 /Users/samsonasik/www/symplify/vendor/rector/rector/src/PhpParser/NodeTraverser/RectorNodeTraverser.php(46): PhpParser\NodeTraverser->traverse(Array)
#14 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Application/FileProcessor.php(53): Rector\Core\PhpParser\NodeTraverser\RectorNodeTraverser->traverse(Array)
#15 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(162): Rector\Core\Application\FileProcessor->refactor(Object(Rector\Core\ValueObject\Application\File))
#16 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(175): Rector\Core\Application\FileProcessor\PhpFileProcessor->Rector\Core\Application\FileProcessor\{closure}(Object(Rector\Core\ValueObject\Application\File))
#17 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(161): Rector\Core\Application\FileProcessor\PhpFileProcessor->tryCatchWrapper(Object(Rector\Core\ValueObject\Application\File), Object(Closure), 'refactoring', Object(Rector\Core\ValueObject\Configuration))
#18 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(106): Rector\Core\Application\FileProcessor\PhpFileProcessor->refactorNodesWithRectors(Array, Object(Rector\Core\ValueObject\Configuration))
#19 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Application/ApplicationFileProcessor.php(65): Rector\Core\Application\FileProcessor\PhpFileProcessor->process(Array, Object(Rector\Core\ValueObject\Configuration))
#20 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Application/ApplicationFileProcessor.php(51): Rector\Core\Application\ApplicationFileProcessor->processFiles(Array, Object(Rector\Core\ValueObject\Configuration))
#21 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Console/Command/ProcessCommand.php(121): Rector\Core\Application\ApplicationFileProcessor->run(Array, Object(Rector\Core\ValueObject\Configuration))
#22 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/symfony/console/Command/Command.php(262): Rector\Core\Console\Command\ProcessCommand->execute(Object(RectorPrefix20210630\Symfony\Component\Console\Input\ArgvInput), Object(RectorPrefix20210630\Symfony\Component\Console\Output\ConsoleOutput))
#23 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/symfony/console/Application.php(828): RectorPrefix20210630\Symfony\Component\Console\Command\Command->run(Object(RectorPrefix20210630\Symfony\Component\Console\Input\ArgvInput), Object(RectorPrefix20210630\Symfony\Component\Console\Output\ConsoleOutput))
#24 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/symfony/console/Application.php(255): RectorPrefix20210630\Symfony\Component\Console\Application->doRunCommand(Object(Rector\Core\Console\Command\ProcessCommand), Object(RectorPrefix20210630\Symfony\Component\Console\Input\ArgvInput), Object(RectorPrefix20210630\Symfony\Component\Console\Output\ConsoleOutput))
#25 /Users/samsonasik/www/symplify/vendor/rector/rector/src/Console/ConsoleApplication.php(67): RectorPrefix20210630\Symfony\Component\Console\Application->doRun(Object(RectorPrefix20210630\Symfony\Component\Console\Input\ArgvInput), Object(RectorPrefix20210630\Symfony\Component\Console\Output\ConsoleOutput))
#26 /Users/samsonasik/www/symplify/vendor/rector/rector/vendor/symfony/console/Application.php(153): Rector\Core\Console\ConsoleApplication->doRun(Object(RectorPrefix20210630\Symfony\Component\Console\Input\ArgvInput), Object(RectorPrefix20210630\Symfony\Component\Console\Output\ConsoleOutput))
#27 /Users/samsonasik/www/symplify/vendor/rector/rector/bin/rector.php(47): RectorPrefix20210630\Symfony\Component\Console\Application->run()
#28 /Users/samsonasik/www/symplify/vendor/rector/rector/bin/rector(5): require_once('/Users/samsonas...')
#29 {main}
thrown in phar:///Users/samsonasik/www/symplify/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ParametersAcceptorSelector.php on line 23 |
I'm looking at this, there might be some false posistives |
TomasVotruba
force-pushed
the
fix-rector-config-prefer-this
branch
2 times, most recently
from
June 30, 2021 13:19
c0f919d
to
56e9256
Compare
TomasVotruba
added a commit
to rectorphp/rector-src
that referenced
this pull request
Jun 30, 2021
TomasVotruba
force-pushed
the
fix-rector-config-prefer-this
branch
from
June 30, 2021 14:11
56e9256
to
94c6f94
Compare
Almost there... I'm releasing Rector 0.11.30 with a fix. It will be ready to merge then ✔️ |
TomasVotruba
added a commit
to rectorphp/rector
that referenced
this pull request
Jun 30, 2021
rectorphp/rector-src@1d1c723 fix multiple variants, see deprecated-packages/symplify#3375
There is more rectorphp/rector-src#341 |
TomasVotruba
force-pushed
the
fix-rector-config-prefer-this
branch
2 times, most recently
from
June 30, 2021 15:54
da971b3
to
d59b7c9
Compare
TomasVotruba
force-pushed
the
fix-rector-config-prefer-this
branch
from
June 30, 2021 15:57
d59b7c9
to
0e44240
Compare
@TomasVotruba thank you |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.