Closed vinioo closed 5 years ago
I'm running through docker
Hi, what happens what you try --autoload-file
from README?
https://github.com/rectorphp/rector#extra-autoloading
I don't use Docker, but @JanMikes might help you
Hi @vinioo what class is it please? Is it your class? Is it vendor class? Is it class that is introduced by some PHP extension?
If it is class added by PHP extension, you might want to check this https://github.com/rectorphp/rector/issues/1547
Hello, thanks for the answers. I solved the problem, just had to add my project path to autoload_paths at rector.yaml.
But, now i am getting the error message "Ambigous class". The project has a lot of duplicated classes. Is there a way to skip it? Or will i need to get just one class anyway?
I solved the problem, just had to add my project path to autoload_paths at rector.yaml.
What does it mean? What does your full rector.yaml
look like?
It's seem you're autoloading something twice
rector.yaml
parameters:
autoload_paths:
- '/dados/webdesktop.git'
Just added the entire project
Ah, I never saw this usage. There should be only vendor/autoload.php
or something similar
how an autoload.php file should looks like?
Well, how do you autoload classes now? Composer or sth?
Minimal PHP code that Rector fails on would help, e.g.
vendor/bin/rector p src/SomeFile.php
# rector.yaml
services:
XYRector: ~
Original question resolved, closing
In case someone ends up here because they need Rector in a different project from the code being processed:
parameters:
autoload_paths:
- '../project_to_process/vendor/autoload.php'
This link no longer exists: https://github.com/rectorphp/rector#extra-autoloading
But it's still given in the error
1416/1416 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% [ERROR] Could not process "../project/src/AppBundle/AppBundle.php" file, due
to:
"Analyze error: "Class AppBundle\AppBundle was not found while trying
to analyse it - discovering symbols is probably not configured
properly.". Include your files in "parameters > autoload_paths".
See https://github.com/rectorphp/rector#extra-autoloading".
The README was changed to drop 50 % of clutter code and show all the options in one file: https://github.com/rectorphp/rector#configuration
I'll update it, thanks :+1:
Hello! I'm trying to run rector but i'm getting the following message: "Class x was not found while trying to
analyse it - autoloading is probably not configured properly.". Include your files in "parameters > autoload_paths".
What should i do? I tried to add a autoload file but i dont get it right. Thanks