System error: Class ... should be known at this point

Aperta
#9,958 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php
Ambito
backend, devtools

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

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.

Lingua principale
PHP
Stelle
10.5k
Fork
742
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rectorphp/rector

Tutte le issue di rectorphp/rector

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.