System error: Class ... should be known at this point
还没有人认领这个 Issue。
评估
调研方向
Start with AddParamBasedOnParentClassMethodRector.php at the reported reflection lookup, then inspect how Rector discovers classes and processes files. The reproducer is the LDAPAccountManager/lam project linked in the report; compare behavior between Rector 2.7.x and 2.8.0 or later. Done means Rector processes the affected files without the reported system error.
由索引模型根据 Issue 内容生成。
描述
Bug Report
| Subject | Details |
|---|---|
| Rector version | 2.8.3 |
I get lots of errors that classes could not be processed because they should be known at this point. This did not happen with 2.7.x and started with version 2.8.0.
Skipping the rule that shows up in the stack trace only leads to a different rule that fails.
Minimal PHP Code Causing Issue
Unable to provide a minimal test case but you can run rector here:
https://github.com/LDAPAccountManager/lam
[ERROR] Could not process
"/home/github/actions-runner2/_work/lam/lam/lam/lib/2factor.inc" file,
due to:
"System error: "Class "LAM\LIB\TWO_FACTOR\BaseProvider" should be known
at this point"
Stack trace:
#0
vendor/rector/rector/rules/Php80/Rector/ClassMethod/AddParamBasedOnPare
ntClassMethodRector.php(119):
Rector\Rector\AbstractRector->fetchClassLikeReflection()
#1 vendor/rector/rector/src/Rector/RectorRunner.php(60):
Rector\Php80\Rector\ClassMethod\AddParamBasedOnParentClassMethodRector-
>refactor()
#2
vendor/rector/rector/src/PhpParser/NodeTraverser/RectorNodeTraverser.ph
p(94): Rector\Rector\RectorRunner->run()
#3
vendor/rector/rector/src/PhpParser/NodeTraverser/RectorNodeTraverser.ph
p(44):
Rector\PhpParser\NodeTraverser\RectorNodeTraverser->traverseArray()
#4
vendor/rector/rector/src/PhpParser/NodeTraverser/RectorNodeTraverser.ph
p(115):
Rector\PhpParser\NodeTraverser\RectorNodeTraverser->traverseNode()
#5
vendor/rector/rector/src/PhpParser/NodeTraverser/RectorNodeTraverser.ph
p(44):
Rector\PhpParser\NodeTraverser\RectorNodeTraverser->traverseArray()
#6
vendor/rector/rector/src/PhpParser/NodeTraverser/RectorNodeTraverser.ph
p(115):
Rector\PhpParser\NodeTraverser\RectorNodeTraverser->traverseNode()
#7
vendor/rector/rector/src/PhpParser/NodeTraverser/RectorNodeTraverser.ph
p(37):
Rector\PhpParser\NodeTraverser\RectorNodeTraverser->traverseArray()
#8 vendor/rector/rector/src/Application/FileProcessor.php(106):
Rector\PhpParser\NodeTraverser\RectorNodeTraverser->traverse()
#9
vendor/rector/rector/src/Application/ApplicationFileProcessor.php(198):
Rector\Application\FileProcessor->processFile()
#10
vendor/rector/rector/src/Application/ApplicationFileProcessor.php(166):
Rector\Application\ApplicationFileProcessor->processFile()
#11
vendor/rector/rector/src/Application/ApplicationFileProcessor.php(136):
Rector\Application\ApplicationFileProcessor->processFiles()
#12 vendor/rector/rector/src/Console/Command/ProcessCommand.php(182):
Rector\Application\ApplicationFileProcessor->run()
#13
vendor/rector/rector/vendor/symfony/console/Command/Command.php(289):
Rector\Console\Command\ProcessCommand->execute()
#14 vendor/rector/rector/vendor/symfony/console/Application.php(920):
RectorPrefix202610\Symfony\Component\Console\Command\Command->run()
#15 vendor/rector/rector/vendor/symfony/console/Application.php(280):
RectorPrefix202610\Symfony\Component\Console\Application->doRunCommand
()
#16 vendor/rector/rector/src/Console/ConsoleApplication.php(75):
RectorPrefix202610\Symfony\Component\Console\Application->doRun()
#17 vendor/rector/rector/vendor/symfony/console/Application.php(163):
Rector\Console\ConsoleApplication->doRun()
#18 vendor/rector/rector/bin/rector.php(171):
RectorPrefix202610\Symfony\Component\Console\Application->run()
#19 vendor/rector/rector/bin/rector(5): require_once('...')
#20 vendor/bin/rector(119): include('...')
#21 {main}". On line: 58
Expected Behaviour
Process the files without system errors.
- 主要语言
- PHP
- 星标
- 10.5k
- 派生
- 742
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rectorphp/rector 的其他 Issue
-
MyCLabsMethodCallToEnumConstRector should only refactor according to RuleDefinition可能已有人在做 @samsonasik 于 2 天前认领。 未关闭bug
难度 3/5 半天 新手友好度 55/100
-
难度 3/5 1-2 天 新手友好度 52/100
相似的 Issue
-
sync-en
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
sync-en
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Перевод устарел
难度 2/5 1-3 小时 新手友好度 64/100
-
难度 2/5 1-3 小时 新手友好度 78/100
Automattic/blocks-engine#4621 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
YunoHost-Apps/snappymail_ynh#205 ·