-
-
Notifications
You must be signed in to change notification settings - Fork 737
Closed
Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | e.g. v2.3.1 (invoke vendor/bin/rector --version) |
| phpstan version | e.g. v2.1.34 (invoke vendor/bin/rector --version) |
Rector 2.3.1 fails when used with PHPStan 2.1.34 due to several breaking API changes in PHPStan. The errors include:
- Removed Visitor Classes
PHP Warning: Undefined array key 0 in PHPStanContainerMemento.php on line 35
[ERROR] "Service name must be a non-empty string." On line: 291
Cause: PHPStan 2.1.34 removed VariadicFunctionsVisitor and VariadicMethodsVisitor
classes. Rector's PHPStanContainerMemento.php still references them.
- Changed
OptimizedSingleFileSourceLocatorConstructor
[ERROR] Argument #2 ($cache) must be of type PHPStan\Cache\Cache, string given
Cause: OptimizedSingleFileSourceLocator::__construct() signature changed from
(FileNodesFetcher, string) to (FileNodesFetcher, Cache, PhpVersion, string).
FiberScopeIntroduction
[ERROR] "Cannot suspend outside of a fiber"
Cause: PHPStan 2.1.34 introduces FiberScope for scope resolution. The node
callback in PHPStanNodeScopeResolver.php expects MutatingScope but now receives
FiberScope.