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

Đang mở
#9,958 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
backend, devtools

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
PHP
Star
10.5k
Fork
742
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rectorphp/rector

Tất cả issue của rectorphp/rector

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.