rectorphp / rector

Instant Upgrades and Automated Refactoring of any PHP 5.3+ code
https://getrector.com
MIT License
8.77k stars 687 forks source link

Could not process due to InlineCodeParser::stringify #3337

Closed frafra closed 4 years ago

frafra commented 4 years ago

Bug Report

Subject Details
Rector version e.g. v0.7.22 (invoke vendor/bin/rector --version)
Installed as composer dependency / prefixed Rector PHAR
 [ERROR] Could not process "include/parser.php" file, due to:                                                         
         "PhpParser\Node\Expr\ArrayDimFetch Rector\Core\PhpParser\Parser\InlineCodeParser::stringify".      

Minimal PHP Code Causing Issue

Unable to produce that. I am trying to fix FluxBB 1.5.11.

Expected Behaviour

Diff should be produced.

TomasVotruba commented 4 years ago

What's the output with --debug?

Demo link with minimal code is needed: https://getrector.org/demo

frafra commented 4 years ago

I am sorry, I am not able to provide that in a reasonable time frame, nor I am a PHP developer. I solved in a different way, by manually changing some functions and moving to a different forum software.

If you have the time and are interested, just try to run reactor over https://fluxbb.org/downloads/ and you will see various errors.

TomasVotruba commented 4 years ago

I see. Thanks for update.

Without provided PHP code, we're unable to fix it.

artem-tim commented 3 years ago

@TomasVotruba Hi, I'm having a similar issue :

> vendor/bin/rector process --dry-run > output
 2676/8530 [▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░]  31%PHP Warning:  Uninitialized string offset -1 in phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Type/Constant/ConstantStringType.php on line 219
Warning: Uninitialized string offset -1 in phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Type/Constant/ConstantStringType.php on line 219
PHP Warning:  Uninitialized string offset -1 in phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Type/Constant/ConstantStringType.php on line 219
Warning: Uninitialized string offset -1 in phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Type/Constant/ConstantStringType.php on line 219
 8252/8530 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░]  96%
In InlineCodeParser.php line 99:info but 

  PhpParser\Node\Expr\MethodCall Rector\Core\PhpParser\Parser\InlineCodeParser::stringify  

process [-n|--dry-run] [-a|--autoload-file AUTOLOAD-FILE] [-o|--output-format [OUTPUT-FORMAT]] [--no-progress-bar] [--no-diffs] [--clear-cache] [--] [<source>...]

> vendor/bin/rector --version
Rector 7dedffe81273dbf59d38b72e2c7ecdc355fd8430

I don't see any indication on what source file could be failing, only this. ouput file is empty as well. I'd like to provide more info but I need pointers on how could I do it

TomasVotruba commented 3 years ago

Hi, try to run it with --debug option. Then run it only on the file that is breaking the process.

artem-tim commented 3 years ago

This is weird. When I ran the command above (without --debug), it took almost 2h to process 8252 out of 8530 files before failing. However when I rerun now with --debug option, it fails almost immediately on one of the first scanned files with the following trace :

...
[parsing] ../github/master/nfs/lib/core/PHPlib.php
[refactoring] ../github/master/nfs/lib/core/PHPlib.php
    [applying] Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector
    [applying] Rector\CodeQuality\Rector\FuncCall\InArrayAndArrayKeysToArrayKeyExistsRector
    [applying] Rector\CodeQuality\Rector\FuncCall\SimplifyFuncGetArgsCountRector
    [applying] Rector\CodeQuality\Rector\FuncCall\SimplifyInArrayValuesRector
    [applying] Rector\CodeQuality\Rector\FuncCall\SimplifyStrposLowerRector
    [applying] Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector
    [applying] Rector\CodeQuality\Rector\FuncCall\SingleInArrayToCompareRector
    [applying] Rector\CodeQuality\Rector\FuncCall\SimplifyRegexPatternRector
    [applying] Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector
    [applying] Rector\CodeQuality\Rector\FuncCall\IsAWithStringWithThirdArgumentRector
    [applying] Rector\CodeQuality\Rector\FuncCall\RemoveSoleValueSprintfRector
    [applying] Rector\CodeQuality\Rector\FuncCall\AddPregQuoteDelimiterRector
    [applying] Rector\CodeQuality\Rector\FuncCall\ArrayMergeOfNonArraysToSimpleArrayRector
    [applying] Rector\CodeQuality\Rector\FuncCall\IntvalToTypeCastRector
    [applying] Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector
    [applying] Rector\CodeQuality\Rector\FuncCall\ArrayKeysAndInArrayToArrayKeyExistsRector
    [applying] Rector\Renaming\Rector\FuncCall\RenameFunctionRector
    [applying] Rector\CodeQuality\Rector\FuncCall\SetTypeToCastRector
    [applying] Rector\CodeQuality\Rector\FuncCall\UnwrapSprintfOneArgumentRector
    [applying] Rector\CodingStyle\Rector\FuncCall\CallUserFuncToMethodCallRector
    [applying] Rector\CodeQuality\Rector\FuncCall\CallUserFuncWithArrowFunctionToInlineRector
    [applying] Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector
    [applying] Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector
    [applying] Rector\Php72\Rector\FuncCall\GetClassOnNullRector
    [applying] Rector\Php72\Rector\FuncCall\StringifyDefineRector
    [applying] Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector
    [applying] Rector\CodeQuality\Rector\Name\FixClassCaseSensitivityNameRector
    [applying] Rector\CodeQuality\Rector\Concat\JoinStringConcatRector
    [applying] Rector\CodeQuality\Rector\Assign\CombinedAssignRector
    [applying] Rector\CodeQuality\Rector\Assign\SplitListAssignToSeparateLineRector
    [applying] Rector\Php72\Rector\Assign\ListEachRector
    [applying] Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector
    [applying] Rector\CodeQuality\Rector\Array_\ArrayThisCallToThisMethodCallRector
    [applying] Rector\CodeQuality\Rector\If_\SimplifyIfNotNullReturnRector
    [applying] Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector
    [applying] Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector
    [applying] Rector\CodeQuality\Rector\If_\ConsecutiveNullCompareReturnsToNullCoalesceQueueRector
    [applying] Rector\CodeQuality\Rector\If_\SimplifyIfIssetToNullCoalescingRector
    [applying] Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector
    [applying] Rector\CodeQuality\Rector\If_\CombineIfRector
    [applying] Rector\CodeQuality\Rector\If_\ShortenElseIfRector
    [applying] Rector\CodeQuality\Rector\If_\SimplifyIfNullableReturnRector
    [applying] Rector\CodeQuality\Rector\Identical\SimplifyConditionsRector
    [applying] Rector\CodeQuality\Rector\BooleanNot\SimplifyDeMorganBinaryRector
    [applying] Rector\CodeQuality\Rector\Identical\BooleanNotIdenticalToNotIdenticalRector
    [applying] Rector\CodeQuality\Rector\Include_\AbsolutizeRequireAndIncludePathRector
    [applying] Rector\CodingStyle\Rector\ClassMethod\FuncGetArgsToVariadicParamRector
    [applying] Rector\CodeQuality\Rector\Foreach_\ForeachToInArrayRector
    [applying] Rector\CodeQuality\Rector\Foreach_\SimplifyForeachToCoalescingRector
    [applying] Rector\CodeQuality\Rector\Foreach_\SimplifyForeachToArrayFilterRector
    [applying] Rector\CodeQuality\Rector\Foreach_\ForeachItemsAssignToEmptyArrayToAssignRector
    [applying] Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector
    [applying] Rector\CodeQuality\Rector\Ternary\UnnecessaryTernaryExpressionRector
    [applying] Rector\CodeQuality\Rector\Ternary\SimplifyTautologyTernaryRector
    [applying] Rector\CodeQuality\Rector\Ternary\SimplifyDuplicatedTernaryRector
    [applying] Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector
    [applying] Rector\CodeQuality\Rector\Ternary\SwitchNegatedTernaryRector
    [applying] Rector\CodeQuality\Rector\Equal\UseIdenticalOverEqualWithSameTypeRector
    [applying] Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector
    [applying] Rector\CodeQuality\Rector\Return_\SimplifyUselessVariableRector
    [applying] Rector\CodeQuality\Rector\Identical\GetClassToInstanceOfRector
    [applying] Rector\CodeQuality\Rector\Identical\SimplifyArraySearchRector
    [applying] Rector\CodeQuality\Rector\Identical\SimplifyBoolIdenticalTrueRector
    [applying] Rector\CodeQuality\Rector\Identical\StrlenZeroToIdenticalEmptyStringRector
    [applying] Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector
    [applying] Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector
    [applying] Rector\CodeQuality\Rector\For_\ForToForeachRector
    [applying] Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector
    [applying] Rector\CodeQuality\Rector\Isset_\IssetOnPropertyObjectToPropertyExistsRector
PHP Fatal error:  Uncaught PHPStan\BetterReflection\Reflector\Exception\IdentifierNotFound: PHPStan\BetterReflection\Reflection\ReflectionClass "Object" could not be found in the located source in phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflector/Exception/IdentifierNotFound.php:24
Stack trace:
#0 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflector/ClassReflector.php(47): PHPStan\BetterReflection\Reflector\Exception\IdentifierNotFound::fromIdentifier()
#1 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/BetterReflection/Reflector/MemoizingClassReflector.php(29): PHPStan\BetterReflection\Reflector\ClassReflector->reflect()
#2 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(649): PHPStan\Reflection\BetterReflection\Reflector\MemoizingClassReflector->reflect()
#3 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(231): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentClass()
#4 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(273): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentMethods()
#5 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(319): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethodsIndexedByName()
#6 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(230): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethods()
#7 [internal function]: PHPStan\BetterReflection\Reflection\ReflectionClass::PHPStan\BetterReflection\Reflection\{closure}()
#8 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(231): array_map()
#9 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(273): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentMethods()
#10 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(319): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethodsIndexedByName()
#11 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(230): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethods()
#12 [internal function]: PHPStan\BetterReflection\Reflection\ReflectionClass::PHPStan\BetterReflection\Reflection\{closure}()
#13 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(231): array_map()
#14 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(273): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentMethods()
#15 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(319): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethodsIndexedByName()
#16 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(230): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethods()
#17 [internal function]: PHPStan\BetterReflection\Reflection\ReflectionClass::PHPStan\BetterReflection\Reflection\{closure}()
#18 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(231): array_map()
#19 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(273): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentMethods()
#20 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(319): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethodsIndexedByName()
#21 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(491): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethods()
#22 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/Adapter/ReflectionClass.php(155): PHPStan\BetterReflection\Reflection\ReflectionClass->getConstructor()
#23 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflection.php(368): PHPStan\BetterReflection\Reflection\Adapter\ReflectionClass->getConstructor()
#24 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflection.php(356): PHPStan\Reflection\ClassReflection->findConstructor()
#25 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(3149): PHPStan\Reflection\ClassReflection->hasConstructor()
#26 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(1154): PHPStan\Analyser\MutatingScope->exactInstantiation()
#27 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(443): PHPStan\Analyser\MutatingScope->resolveType()
#28 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(699): PHPStan\Analyser\MutatingScope->getType()
#29 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(443): PHPStan\Analyser\MutatingScope->resolveType()
#30 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(1345): PHPStan\Analyser\MutatingScope->getType()
#31 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(460): PHPStan\Analyser\NodeScopeResolver->findEarlyTerminatingExpr()
#32 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(259): PHPStan\Analyser\NodeScopeResolver->processStmtNode()
#33 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(550): PHPStan\Analyser\NodeScopeResolver->processStmtNodes()
#34 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(259): PHPStan\Analyser\NodeScopeResolver->processStmtNode()
#35 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(568): PHPStan\Analyser\NodeScopeResolver->processStmtNodes()
#36 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(259): PHPStan\Analyser\NodeScopeResolver->processStmtNode()
#37 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(367): PHPStan\Analyser\NodeScopeResolver->processStmtNodes()
#38 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(227): PHPStan\Analyser\NodeScopeResolver->processStmtNode()
#39 /home/artem/php/vendor/rector/rector/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php(154): PHPStan\Analyser\NodeScopeResolver->processNodes()
#40 /home/artem/php/vendor/rector/rector/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php(143): Rector\NodeTypeResolver\PHPStan\Scope\PHPStanNodeScopeResolver->processNodesWithMixinHandling()
#41 /home/artem/php/vendor/rector/rector/packages/NodeTypeResolver/NodeScopeAndMetadataDecorator.php(81): Rector\NodeTypeResolver\PHPStan\Scope\PHPStanNodeScopeResolver->processNodes()
#42 /home/artem/php/vendor/rector/rector/src/PhpParser/AstResolver.php(357): Rector\NodeTypeResolver\NodeScopeAndMetadataDecorator->decorateNodesFromFile()
#43 /home/artem/php/vendor/rector/rector/src/PhpParser/AstResolver.php(188): Rector\Core\PhpParser\AstResolver->parseFileNameToDecoratedNodes()
#44 /home/artem/php/vendor/rector/rector/src/NodeAnalyzer/VariadicAnalyzer.php(56): Rector\Core\PhpParser\AstResolver->resolveFunctionFromFunctionReflection()
#45 /home/artem/php/vendor/rector/rector/rules/Php71/Rector/FuncCall/RemoveExtraParametersRector.php(106): Rector\Core\NodeAnalyzer\VariadicAnalyzer->hasVariadicParameters()
#46 /home/artem/php/vendor/rector/rector/rules/Php71/Rector/FuncCall/RemoveExtraParametersRector.php(63): Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector->shouldSkip()
#47 /home/artem/php/vendor/rector/rector/src/Rector/AbstractRector.php(242): Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector->refactor()
#48 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(113): Rector\Core\Rector\AbstractRector->enterNode()
#49 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(133): PhpParser\NodeTraverser->traverseNode()
#50 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(133): PhpParser\NodeTraverser->traverseNode()
#51 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(133): PhpParser\NodeTraverser->traverseNode()
#52 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196): PhpParser\NodeTraverser->traverseNode()
#53 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105): PhpParser\NodeTraverser->traverseArray()
#54 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196): PhpParser\NodeTraverser->traverseNode()
#55 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105): PhpParser\NodeTraverser->traverseArray()
#56 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196): PhpParser\NodeTraverser->traverseNode()
#57 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105): PhpParser\NodeTraverser->traverseArray()
#58 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196): PhpParser\NodeTraverser->traverseNode()
#59 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(85): PhpParser\NodeTraverser->traverseArray()
#60 /home/artem/php/vendor/rector/rector/src/PhpParser/NodeTraverser/RectorNodeTraverser.php(50): PhpParser\NodeTraverser->traverse()
#61 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor.php(54): Rector\Core\PhpParser\NodeTraverser\RectorNodeTraverser->traverse()
#62 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(132): Rector\Core\Application\FileProcessor->refactor()
#63 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(144): Rector\Core\Application\FileProcessor\PhpFileProcessor->Rector\Core\Application\FileProcessor\{closure}()
#64 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(133): Rector\Core\Application\FileProcessor\PhpFileProcessor->tryCatchWrapper()
#65 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(91): Rector\Core\Application\FileProcessor\PhpFileProcessor->refactorNodesWithRectors()
#66 /home/artem/php/vendor/rector/rector/src/Application/ApplicationFileProcessor.php(76): Rector\Core\Application\FileProcessor\PhpFileProcessor->process()
#67 /home/artem/php/vendor/rector/rector/src/Application/ApplicationFileProcessor.php(57): Rector\Core\Application\ApplicationFileProcessor->processFiles()
#68 /home/artem/php/vendor/rector/rector/src/Console/Command/ProcessCommand.php(144): Rector\Core\Application\ApplicationFileProcessor->run()
#69 /home/artem/php/vendor/rector/rector/vendor/symfony/console/Command/Command.php(274): Rector\Core\Console\Command\ProcessCommand->execute()
#70 /home/artem/php/vendor/rector/rector/vendor/symfony/console/Application.php(870): RectorPrefix20210928\Symfony\Component\Console\Command\Command->run()
#71 /home/artem/php/vendor/rector/rector/vendor/symfony/console/Application.php(266): RectorPrefix20210928\Symfony\Component\Console\Application->doRunCommand()
#72 /home/artem/php/vendor/rector/rector/src/Console/ConsoleApplication.php(71): RectorPrefix20210928\Symfony\Component\Console\Application->doRun()
#73 /home/artem/php/vendor/rector/rector/vendor/symfony/console/Application.php(162): Rector\Core\Console\ConsoleApplication->doRun()
#74 /home/artem/php/vendor/rector/rector/bin/rector.php(63): RectorPrefix20210928\Symfony\Component\Console\Application->run()
#75 /home/artem/php/vendor/rector/rector/bin/rector(5): require_once('...')
#76 {main}
  thrown in phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflector/Exception/IdentifierNotFound.php on line 24
Fatal error: Uncaught PHPStan\BetterReflection\Reflector\Exception\IdentifierNotFound: PHPStan\BetterReflection\Reflection\ReflectionClass "Object" could not be found in the located source in phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflector/Exception/IdentifierNotFound.php:24
Stack trace:
#0 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflector/ClassReflector.php(47): PHPStan\BetterReflection\Reflector\Exception\IdentifierNotFound::fromIdentifier()
#1 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/BetterReflection/Reflector/MemoizingClassReflector.php(29): PHPStan\BetterReflection\Reflector\ClassReflector->reflect()
#2 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(649): PHPStan\Reflection\BetterReflection\Reflector\MemoizingClassReflector->reflect()
#3 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(231): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentClass()
#4 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(273): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentMethods()
#5 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(319): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethodsIndexedByName()
#6 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(230): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethods()
#7 [internal function]: PHPStan\BetterReflection\Reflection\ReflectionClass::PHPStan\BetterReflection\Reflection\{closure}()
#8 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(231): array_map()
#9 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(273): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentMethods()
#10 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(319): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethodsIndexedByName()
#11 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(230): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethods()
#12 [internal function]: PHPStan\BetterReflection\Reflection\ReflectionClass::PHPStan\BetterReflection\Reflection\{closure}()
#13 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(231): array_map()
#14 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(273): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentMethods()
#15 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(319): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethodsIndexedByName()
#16 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(230): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethods()
#17 [internal function]: PHPStan\BetterReflection\Reflection\ReflectionClass::PHPStan\BetterReflection\Reflection\{closure}()
#18 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(231): array_map()
#19 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(273): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentMethods()
#20 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(319): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethodsIndexedByName()
#21 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(491): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethods()
#22 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/Adapter/ReflectionClass.php(155): PHPStan\BetterReflection\Reflection\ReflectionClass->getConstructor()
#23 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflection.php(368): PHPStan\BetterReflection\Reflection\Adapter\ReflectionClass->getConstructor()
#24 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflection.php(356): PHPStan\Reflection\ClassReflection->findConstructor()
#25 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(3149): PHPStan\Reflection\ClassReflection->hasConstructor()
#26 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(1154): PHPStan\Analyser\MutatingScope->exactInstantiation()
#27 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(443): PHPStan\Analyser\MutatingScope->resolveType()
#28 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(699): PHPStan\Analyser\MutatingScope->getType()
#29 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(443): PHPStan\Analyser\MutatingScope->resolveType()
#30 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(1345): PHPStan\Analyser\MutatingScope->getType()
#31 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(460): PHPStan\Analyser\NodeScopeResolver->findEarlyTerminatingExpr()
#32 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(259): PHPStan\Analyser\NodeScopeResolver->processStmtNode()
#33 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(550): PHPStan\Analyser\NodeScopeResolver->processStmtNodes()
#34 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(259): PHPStan\Analyser\NodeScopeResolver->processStmtNode()
#35 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(568): PHPStan\Analyser\NodeScopeResolver->processStmtNodes()
#36 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(259): PHPStan\Analyser\NodeScopeResolver->processStmtNode()
#37 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(367): PHPStan\Analyser\NodeScopeResolver->processStmtNodes()
#38 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(227): PHPStan\Analyser\NodeScopeResolver->processStmtNode()
#39 /home/artem/php/vendor/rector/rector/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php(154): PHPStan\Analyser\NodeScopeResolver->processNodes()
#40 /home/artem/php/vendor/rector/rector/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php(143): Rector\NodeTypeResolver\PHPStan\Scope\PHPStanNodeScopeResolver->processNodesWithMixinHandling()
#41 /home/artem/php/vendor/rector/rector/packages/NodeTypeResolver/NodeScopeAndMetadataDecorator.php(81): Rector\NodeTypeResolver\PHPStan\Scope\PHPStanNodeScopeResolver->processNodes()
#42 /home/artem/php/vendor/rector/rector/src/PhpParser/AstResolver.php(357): Rector\NodeTypeResolver\NodeScopeAndMetadataDecorator->decorateNodesFromFile()
#43 /home/artem/php/vendor/rector/rector/src/PhpParser/AstResolver.php(188): Rector\Core\PhpParser\AstResolver->parseFileNameToDecoratedNodes()
#44 /home/artem/php/vendor/rector/rector/src/NodeAnalyzer/VariadicAnalyzer.php(56): Rector\Core\PhpParser\AstResolver->resolveFunctionFromFunctionReflection()
#45 /home/artem/php/vendor/rector/rector/rules/Php71/Rector/FuncCall/RemoveExtraParametersRector.php(106): Rector\Core\NodeAnalyzer\VariadicAnalyzer->hasVariadicParameters()
#46 /home/artem/php/vendor/rector/rector/rules/Php71/Rector/FuncCall/RemoveExtraParametersRector.php(63): Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector->shouldSkip()
#47 /home/artem/php/vendor/rector/rector/src/Rector/AbstractRector.php(242): Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector->refactor()
#48 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(113): Rector\Core\Rector\AbstractRector->enterNode()
#49 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(133): PhpParser\NodeTraverser->traverseNode()
#50 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(133): PhpParser\NodeTraverser->traverseNode()
#51 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(133): PhpParser\NodeTraverser->traverseNode()
#52 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196): PhpParser\NodeTraverser->traverseNode()
#53 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105): PhpParser\NodeTraverser->traverseArray()
#54 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196): PhpParser\NodeTraverser->traverseNode()
#55 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105): PhpParser\NodeTraverser->traverseArray()
#56 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196): PhpParser\NodeTraverser->traverseNode()
#57 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105): PhpParser\NodeTraverser->traverseArray()
#58 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196): PhpParser\NodeTraverser->traverseNode()
#59 /home/artem/php/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(85): PhpParser\NodeTraverser->traverseArray()
#60 /home/artem/php/vendor/rector/rector/src/PhpParser/NodeTraverser/RectorNodeTraverser.php(50): PhpParser\NodeTraverser->traverse()
#61 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor.php(54): Rector\Core\PhpParser\NodeTraverser\RectorNodeTraverser->traverse()
#62 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(132): Rector\Core\Application\FileProcessor->refactor()
#63 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(144): Rector\Core\Application\FileProcessor\PhpFileProcessor->Rector\Core\Application\FileProcessor\{closure}()
#64 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(133): Rector\Core\Application\FileProcessor\PhpFileProcessor->tryCatchWrapper()
#65 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(91): Rector\Core\Application\FileProcessor\PhpFileProcessor->refactorNodesWithRectors()
#66 /home/artem/php/vendor/rector/rector/src/Application/ApplicationFileProcessor.php(76): Rector\Core\Application\FileProcessor\PhpFileProcessor->process()
#67 /home/artem/php/vendor/rector/rector/src/Application/ApplicationFileProcessor.php(57): Rector\Core\Application\ApplicationFileProcessor->processFiles()
#68 /home/artem/php/vendor/rector/rector/src/Console/Command/ProcessCommand.php(144): Rector\Core\Application\ApplicationFileProcessor->run()
#69 /home/artem/php/vendor/rector/rector/vendor/symfony/console/Command/Command.php(274): Rector\Core\Console\Command\ProcessCommand->execute()
#70 /home/artem/php/vendor/rector/rector/vendor/symfony/console/Application.php(870): RectorPrefix20210928\Symfony\Component\Console\Command\Command->run()
#71 /home/artem/php/vendor/rector/rector/vendor/symfony/console/Application.php(266): RectorPrefix20210928\Symfony\Component\Console\Application->doRunCommand()
#72 /home/artem/php/vendor/rector/rector/src/Console/ConsoleApplication.php(71): RectorPrefix20210928\Symfony\Component\Console\Application->doRun()
#73 /home/artem/php/vendor/rector/rector/vendor/symfony/console/Application.php(162): Rector\Core\Console\ConsoleApplication->doRun()
#74 /home/artem/php/vendor/rector/rector/bin/rector.php(63): RectorPrefix20210928\Symfony\Component\Console\Application->run()
#75 /home/artem/php/vendor/rector/rector/bin/rector(5): require_once('...')
#76 {main}
  thrown in phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflector/Exception/IdentifierNotFound.php on line 24

However, if I specify only the file mentioned before the Fatal error PHPlib.php as path :

    $parameters->set(Option::PATHS, [
        '/home/artem/github/master/nfs/lib/core/PHPlib.php'
    ]);

Then the processing goes well with a single warning ("1 nodes were removed") but status OK

TomasVotruba commented 3 years ago

Good 👍

It's better to use absolute path in rector.php. It will be in some other file probably. Maybe the directory above

artem-tim commented 3 years ago

The fail is happening when I'm scanning my application with the following rector.php :

<?php

declare(strict_types=1);

use Rector\Core\Configuration\Option;
use Rector\Php74\Rector\Property\TypedPropertyRector;
use Rector\Set\ValueObject\SetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
    // get parameters
    $parameters = $containerConfigurator->parameters();
    $parameters->set(Option::PATHS, [
        '/home/artem/github/master/nfs/lib'
    ]);

    $parameters->set(Option::SKIP, [
        '/home/artem/github/master/nfs/lib/vendor'
    ]);

    // Define what rule sets will be applied
    $containerConfigurator->import(SetList::CODE_QUALITY);

    // get services (needed for register a single rule)
    $services = $containerConfigurator->services();

    // register a single rule
    $services->set(Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector::class);
    $services->set(Rector\Php72\Rector\FuncCall\GetClassOnNullRector::class);
    $services->set(Rector\Php72\Rector\Assign\ListEachRector::class);
    $services->set(Rector\Php72\Rector\FuncCall\StringifyDefineRector::class);
    $services->set(Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector::class);
};

Is there anything I can do (maybe disabling any specific rule) ?

TomasVotruba commented 3 years ago

The problem can be in many places, I'm unable to tell based on config. Could you create reproducible repository?

artem-tim commented 3 years ago

Sorry, this codebase is private so I'm not allowed to share it as-is. However I'm trying to locate the problem by minimizing scanned code, and it's a struggle - the debug info does not help understanding exactly which file causes the problem. This is what I did :

  1. Removed all rules except a single one : Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector (any rule seems to trigger the error)
  2. Run the processing on the codebase. Full log :
    > vendor/bin/rector process --dry-run --debug
    [parsing] src/ExtData.php
    [refactoring] src/ExtData.php
    [applying] Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector
    [post rectors] src/ExtData.php
    [print] src/ExtData.php
    [parsing] src/ExternalData.php
    [refactoring] src/ExternalData.php
    [applying] Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector
    [post rectors] src/ExternalData.php
    [print] src/ExternalData.php
    [parsing] src/bat_exe.php
    [refactoring] src/bat_exe.php
    [applying] Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector
    [post rectors] src/bat_exe.php
    [print] src/bat_exe.php
    [parsing] src/bat_exe2.php
    [refactoring] src/bat_exe2.php
    [post rectors] src/bat_exe2.php
    [print] src/bat_exe2.php
    [parsing] src/bat_polling_queue.php
    [refactoring] src/bat_polling_queue.php
    [applying] Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector
    [post rectors] src/bat_polling_queue.php
    [print] src/bat_polling_queue.php
    [parsing] src/bat_polling_queue2.php
    [refactoring] src/bat_polling_queue2.php
    [applying] Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector
    [post rectors] src/bat_polling_queue2.php
    [print] src/bat_polling_queue2.php
    [parsing] src/config.php
    [refactoring] src/config.php
    [applying] Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector
    [post rectors] src/config.php
    [print] src/config.php
    [parsing] src/core/CustomSearch.php
    [refactoring] src/core/CustomSearch.php
    [applying] Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector
    [post rectors] src/core/CustomSearch.php
    [print] src/core/CustomSearch.php
    [parsing] src/core/DBSearch.php
    [refactoring] src/core/DBSearch.php
    [applying] Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector
    [post rectors] src/core/DBSearch.php
    [print] src/core/DBSearch.php
    [parsing] src/core/PHPlib.php
    [refactoring] src/core/PHPlib.php
    [applying] Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector
    [post rectors] src/core/PHPlib.php
    [print] src/core/PHPlib.php
    [parsing] src/core/Relationlib.php
    [refactoring] src/core/Relationlib.php
    [applying] Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector
    [post rectors] src/core/Relationlib.php
    [print] src/core/Relationlib.php
    [parsing] src/core/Session.php
    [refactoring] src/core/Session.php
    [applying] Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector
    [post rectors] src/core/Session.php
    [print] src/core/Session.php
    [parsing] src/core/Smarty.php
    [refactoring] src/core/Smarty.php
    [applying] Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector
    [post rectors] src/core/Smarty.php
    [print] src/core/Smarty.php
    [parsing] src/core/admin_controller.php
    [refactoring] src/core/admin_controller.php
    [applying] Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector
    [post rectors] src/core/admin_controller.php
    [print] src/core/admin_controller.php
    [parsing] src/core/api_controller.php
    [refactoring] src/core/api_controller.php
    [applying] Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector
    [post rectors] src/core/api_controller.php
    [print] src/core/api_controller.php
    [parsing] src/core/common.php
    PHP Fatal error:  Uncaught PHPStan\BetterReflection\Reflector\Exception\IdentifierNotFound: PHPStan\BetterReflection\Reflection\ReflectionClass "Object" could not be found in the located source in phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflector/Exception/IdentifierNotFound.php:24
    Stack trace:
    #0 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflector/ClassReflector.php(47): PHPStan\BetterReflection\Reflector\Exception\IdentifierNotFound::fromIdentifier()
    #1 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/BetterReflection/Reflector/MemoizingClassReflector.php(29): PHPStan\BetterReflection\Reflector\ClassReflector->reflect()
    #2 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(649): PHPStan\Reflection\BetterReflection\Reflector\MemoizingClassReflector->reflect()
    #3 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(231): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentClass()
    #4 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(273): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentMethods()
    #5 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(319): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethodsIndexedByName()
    #6 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(230): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethods()
    #7 [internal function]: PHPStan\BetterReflection\Reflection\ReflectionClass::PHPStan\BetterReflection\Reflection\{closure}()
    #8 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(231): array_map()
    #9 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(273): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentMethods()
    #10 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(319): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethodsIndexedByName()
    #11 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(230): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethods()
    #12 [internal function]: PHPStan\BetterReflection\Reflection\ReflectionClass::PHPStan\BetterReflection\Reflection\{closure}()
    #13 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(231): array_map()
    #14 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(273): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentMethods()
    #15 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(319): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethodsIndexedByName()
    #16 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(230): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethods()
    #17 [internal function]: PHPStan\BetterReflection\Reflection\ReflectionClass::PHPStan\BetterReflection\Reflection\{closure}()
    #18 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(231): array_map()
    #19 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(273): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentMethods()
    #20 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(319): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethodsIndexedByName()
    #21 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(491): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethods()
    #22 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/Adapter/ReflectionClass.php(155): PHPStan\BetterReflection\Reflection\ReflectionClass->getConstructor()
    #23 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflection.php(368): PHPStan\BetterReflection\Reflection\Adapter\ReflectionClass->getConstructor()
    #24 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflection.php(356): PHPStan\Reflection\ClassReflection->findConstructor()
    #25 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(3149): PHPStan\Reflection\ClassReflection->hasConstructor()
    #26 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(1154): PHPStan\Analyser\MutatingScope->exactInstantiation()
    #27 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(443): PHPStan\Analyser\MutatingScope->resolveType()
    #28 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(699): PHPStan\Analyser\MutatingScope->getType()
    #29 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(443): PHPStan\Analyser\MutatingScope->resolveType()
    #30 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(1345): PHPStan\Analyser\MutatingScope->getType()
    #31 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(460): PHPStan\Analyser\NodeScopeResolver->findEarlyTerminatingExpr()
    #32 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(259): PHPStan\Analyser\NodeScopeResolver->processStmtNode()
    #33 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(550): PHPStan\Analyser\NodeScopeResolver->processStmtNodes()
    #34 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(259): PHPStan\Analyser\NodeScopeResolver->processStmtNode()
    #35 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(568): PHPStan\Analyser\NodeScopeResolver->processStmtNodes()
    #36 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(259): PHPStan\Analyser\NodeScopeResolver->processStmtNode()
    #37 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(367): PHPStan\Analyser\NodeScopeResolver->processStmtNodes()
    #38 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(227): PHPStan\Analyser\NodeScopeResolver->processStmtNode()
    #39 /home/artem/php/vendor/rector/rector/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php(154): PHPStan\Analyser\NodeScopeResolver->processNodes()
    #40 /home/artem/php/vendor/rector/rector/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php(143): Rector\NodeTypeResolver\PHPStan\Scope\PHPStanNodeScopeResolver->processNodesWithMixinHandling()
    #41 /home/artem/php/vendor/rector/rector/packages/NodeTypeResolver/NodeScopeAndMetadataDecorator.php(81): Rector\NodeTypeResolver\PHPStan\Scope\PHPStanNodeScopeResolver->processNodes()
    #42 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor.php(49): Rector\NodeTypeResolver\NodeScopeAndMetadataDecorator->decorateNodesFromFile()
    #43 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(80): Rector\Core\Application\FileProcessor->parseFileInfoToLocalCache()
    #44 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(144): Rector\Core\Application\FileProcessor\PhpFileProcessor->Rector\Core\Application\FileProcessor\{closure}()
    #45 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(81): Rector\Core\Application\FileProcessor\PhpFileProcessor->tryCatchWrapper()
    #46 /home/artem/php/vendor/rector/rector/src/Application/ApplicationFileProcessor.php(76): Rector\Core\Application\FileProcessor\PhpFileProcessor->process()
    #47 /home/artem/php/vendor/rector/rector/src/Application/ApplicationFileProcessor.php(57): Rector\Core\Application\ApplicationFileProcessor->processFiles()
    #48 /home/artem/php/vendor/rector/rector/src/Console/Command/ProcessCommand.php(144): Rector\Core\Application\ApplicationFileProcessor->run()
    #49 /home/artem/php/vendor/rector/rector/vendor/symfony/console/Command/Command.php(274): Rector\Core\Console\Command\ProcessCommand->execute()
    #50 /home/artem/php/vendor/rector/rector/vendor/symfony/console/Application.php(870): RectorPrefix20210928\Symfony\Component\Console\Command\Command->run()
    #51 /home/artem/php/vendor/rector/rector/vendor/symfony/console/Application.php(266): RectorPrefix20210928\Symfony\Component\Console\Application->doRunCommand()
    #52 /home/artem/php/vendor/rector/rector/src/Console/ConsoleApplication.php(71): RectorPrefix20210928\Symfony\Component\Console\Application->doRun()
    #53 /home/artem/php/vendor/rector/rector/vendor/symfony/console/Application.php(162): Rector\Core\Console\ConsoleApplication->doRun()
    #54 /home/artem/php/vendor/rector/rector/bin/rector.php(63): RectorPrefix20210928\Symfony\Component\Console\Application->run()
    #55 /home/artem/php/vendor/rector/rector/bin/rector(5): require_once('...')
    #56 {main}
    thrown in phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflector/Exception/IdentifierNotFound.php on line 24
    Fatal error: Uncaught PHPStan\BetterReflection\Reflector\Exception\IdentifierNotFound: PHPStan\BetterReflection\Reflection\ReflectionClass "Object" could not be found in the located source in phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflector/Exception/IdentifierNotFound.php:24
    Stack trace:
    #0 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflector/ClassReflector.php(47): PHPStan\BetterReflection\Reflector\Exception\IdentifierNotFound::fromIdentifier()
    #1 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/BetterReflection/Reflector/MemoizingClassReflector.php(29): PHPStan\BetterReflection\Reflector\ClassReflector->reflect()
    #2 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(649): PHPStan\Reflection\BetterReflection\Reflector\MemoizingClassReflector->reflect()
    #3 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(231): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentClass()
    #4 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(273): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentMethods()
    #5 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(319): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethodsIndexedByName()
    #6 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(230): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethods()
    #7 [internal function]: PHPStan\BetterReflection\Reflection\ReflectionClass::PHPStan\BetterReflection\Reflection\{closure}()
    #8 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(231): array_map()
    #9 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(273): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentMethods()
    #10 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(319): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethodsIndexedByName()
    #11 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(230): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethods()
    #12 [internal function]: PHPStan\BetterReflection\Reflection\ReflectionClass::PHPStan\BetterReflection\Reflection\{closure}()
    #13 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(231): array_map()
    #14 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(273): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentMethods()
    #15 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(319): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethodsIndexedByName()
    #16 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(230): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethods()
    #17 [internal function]: PHPStan\BetterReflection\Reflection\ReflectionClass::PHPStan\BetterReflection\Reflection\{closure}()
    #18 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(231): array_map()
    #19 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(273): PHPStan\BetterReflection\Reflection\ReflectionClass->getParentMethods()
    #20 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(319): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethodsIndexedByName()
    #21 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php(491): PHPStan\BetterReflection\Reflection\ReflectionClass->getMethods()
    #22 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/Adapter/ReflectionClass.php(155): PHPStan\BetterReflection\Reflection\ReflectionClass->getConstructor()
    #23 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflection.php(368): PHPStan\BetterReflection\Reflection\Adapter\ReflectionClass->getConstructor()
    #24 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflection.php(356): PHPStan\Reflection\ClassReflection->findConstructor()
    #25 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(3149): PHPStan\Reflection\ClassReflection->hasConstructor()
    #26 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(1154): PHPStan\Analyser\MutatingScope->exactInstantiation()
    #27 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(443): PHPStan\Analyser\MutatingScope->resolveType()
    #28 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(699): PHPStan\Analyser\MutatingScope->getType()
    #29 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(443): PHPStan\Analyser\MutatingScope->resolveType()
    #30 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(1345): PHPStan\Analyser\MutatingScope->getType()
    #31 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(460): PHPStan\Analyser\NodeScopeResolver->findEarlyTerminatingExpr()
    #32 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(259): PHPStan\Analyser\NodeScopeResolver->processStmtNode()
    #33 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(550): PHPStan\Analyser\NodeScopeResolver->processStmtNodes()
    #34 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(259): PHPStan\Analyser\NodeScopeResolver->processStmtNode()
    #35 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(568): PHPStan\Analyser\NodeScopeResolver->processStmtNodes()
    #36 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(259): PHPStan\Analyser\NodeScopeResolver->processStmtNode()
    #37 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(367): PHPStan\Analyser\NodeScopeResolver->processStmtNodes()
    #38 phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(227): PHPStan\Analyser\NodeScopeResolver->processStmtNode()
    #39 /home/artem/php/vendor/rector/rector/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php(154): PHPStan\Analyser\NodeScopeResolver->processNodes()
    #40 /home/artem/php/vendor/rector/rector/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php(143): Rector\NodeTypeResolver\PHPStan\Scope\PHPStanNodeScopeResolver->processNodesWithMixinHandling()
    #41 /home/artem/php/vendor/rector/rector/packages/NodeTypeResolver/NodeScopeAndMetadataDecorator.php(81): Rector\NodeTypeResolver\PHPStan\Scope\PHPStanNodeScopeResolver->processNodes()
    #42 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor.php(49): Rector\NodeTypeResolver\NodeScopeAndMetadataDecorator->decorateNodesFromFile()
    #43 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(80): Rector\Core\Application\FileProcessor->parseFileInfoToLocalCache()
    #44 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(144): Rector\Core\Application\FileProcessor\PhpFileProcessor->Rector\Core\Application\FileProcessor\{closure}()
    #45 /home/artem/php/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php(81): Rector\Core\Application\FileProcessor\PhpFileProcessor->tryCatchWrapper()
    #46 /home/artem/php/vendor/rector/rector/src/Application/ApplicationFileProcessor.php(76): Rector\Core\Application\FileProcessor\PhpFileProcessor->process()
    #47 /home/artem/php/vendor/rector/rector/src/Application/ApplicationFileProcessor.php(57): Rector\Core\Application\ApplicationFileProcessor->processFiles()
    #48 /home/artem/php/vendor/rector/rector/src/Console/Command/ProcessCommand.php(144): Rector\Core\Application\ApplicationFileProcessor->run()
    #49 /home/artem/php/vendor/rector/rector/vendor/symfony/console/Command/Command.php(274): Rector\Core\Console\Command\ProcessCommand->execute()
    #50 /home/artem/php/vendor/rector/rector/vendor/symfony/console/Application.php(870): RectorPrefix20210928\Symfony\Component\Console\Command\Command->run()
    #51 /home/artem/php/vendor/rector/rector/vendor/symfony/console/Application.php(266): RectorPrefix20210928\Symfony\Component\Console\Application->doRunCommand()
    #52 /home/artem/php/vendor/rector/rector/src/Console/ConsoleApplication.php(71): RectorPrefix20210928\Symfony\Component\Console\Application->doRun()
    #53 /home/artem/php/vendor/rector/rector/vendor/symfony/console/Application.php(162): Rector\Core\Console\ConsoleApplication->doRun()
    #54 /home/artem/php/vendor/rector/rector/bin/rector.php(63): RectorPrefix20210928\Symfony\Component\Console\Application->run()
    #55 /home/artem/php/vendor/rector/rector/bin/rector(5): require_once('...')
    #56 {main}
    thrown in phar:///home/artem/php/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflector/Exception/IdentifierNotFound.php on line 24

The line right before the Fatal Error is saying [parsing] src/core/common.php, so I was thinking hey it may be common.php file - but then I removed its content entirely - here is new common.php :

<?php
// Empty common.php file

But the output above remained the same - so the error must be in another file. If I try removing parts of the codebase (or run on subsets), error becomes something like Uncaught PHPStan\BetterReflection\Reflector\Exception\IdentifierNotFound: PHPStan\BetterReflection\Reflection\ReflectionClass "<RealClassNameFromDeletedFile>" could not be found in the located source

Basically, Rector requires full application at path or it doesnt work (broken dependencies as classes dont load). Unitary file testing on some files is OK. But the full app processing breaks.

I'm sorry to be unable to provide the full source for you to check, but if you could give me any pointers about how I could dig deeper and find the origin of the error, that would be awesome