mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-31 08:20:53 +00:00
Documenting a solution for missing classes (#889)
See https://github.com/rectorphp/rector/issues/6688
This commit is contained in:
parent
ae01efed9c
commit
be1cdc059d
|
@ -74,4 +74,19 @@ If the false positive still happen, you can skip the rule applied as last resort
|
|||
__DIR__ . '/src/HasChildClass.php',
|
||||
],
|
||||
]);
|
||||
```
|
||||
```
|
||||
|
||||
### Dealing with "Class ... was not found while trying to analyse it..."
|
||||
Sometimes you may encounter this error ([see here for an example](https://github.com/rectorphp/rector/issues/6688)) even if the class is there and it seems to work properly with other tools (e.g. PHPStan).
|
||||
|
||||
In this case you may want to try one of the following solutions:
|
||||
```php
|
||||
$parameters->set(Option::AUTOLOAD_PATHS, [
|
||||
// the path to the exact class file
|
||||
__DIR__ . '/vendor/acme/my-custom-dependency/src/Your/Own/Namespace/TheAffectedClass.php',
|
||||
// or you can specify a wider scope
|
||||
__DIR__ . '/vendor/acme/my-custom-dependency/src',
|
||||
// WARNING: beware of performances, try to narrow down the path
|
||||
// as much as you can or you will slow down each run
|
||||
]);
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue
Block a user