rector: [Parallel]: Class was not found while trying to analyse it
Bug Report
| Subject | Details |
|---|---|
| Rector version | 0.12.10 |
Minimal PHP Code Causing Issue
When enable parallel option, it can got error:
[ERROR] Could not process "tests/system/Files/FileCollectionTest.php" file, due to:
"System error: "Class FileCollectionTest was not found while trying to analyse it - discovering symbols is
probably not configured properly."
Run Rector with "--debug" option and post the report here: https://github.com/rectorphp/rector/issues/new". On
line: 45
Step to reproduce:
- Clone repo
git clone git@github.com:codeigniter4/CodeIgniter4.git
- Run composer install
composer install
- Open
rector.php, add option parall:
$parameters->set(Option::PARALLEL, true);
- Run against
testsdirectory:
vendor/bin/rector process tests
Expected Behaviour
It should show [OK] Rector is done! without diff and error:
vendor/bin/rector process tests
257/257 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
[OK] Rector is done!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 32 (9 by maintainers)
@MGatner how about add
vendor/codeigniter4/framework/system/Test/bootstrap.phpinto “files” config in composer.json? Ref https://github.com/rectorphp/rector/blob/main/docs/static_reflection_and_autoload.md#dealing-with-class--was-not-found-while-trying-to-analyse-it@TomasVotruba I created e2e tests for it at https://github.com/rectorphp/rector-src/pull/1613
If I strip that one file down to the following (note public property)
Then its fine, but change the property back to private and then it breaks consistently.
Even if I change the class name, public property works, private property causes issues.
Hope that helps.