New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MutatingScope not being covered by backward compatibility promise #7516
Comments
Your example shows a different error - please send a PR that adds But with bleedingEdge yeah, the assert() is marked too: https://phpstan.org/r/eb34f039-7994-4588-9755-a749aafa6db9 I'll see what can be done about it, thanks |
@vojtech-dobes After the latest commit in 1.7.x, PHPStan now reports different result with your code snippet: @@ @@
-58: Asking about instanceof PHPStan\Analyser\MutatingScope is not covered by backward compatibility promise. The class might change in a minor PHPStan version.
-60: Calling PHPStan\Analyser\NodeScopeResolver::processStmtNodes() is not covered by backward compatibility promise. The method might change in a minor PHPStan version.
+58: Asking about instanceof PHPStan\Analyser\MutatingScope is not covered by backward compatibility promise. The class might change in a minor PHPStan version. Full report
|
@ondrejmirtes After the latest commit in 1.7.x, PHPStan now reports different result with your code snippet: @@ @@
-58: Asking about instanceof PHPStan\Analyser\MutatingScope is not covered by backward compatibility promise. The class might change in a minor PHPStan version.
-60: Calling PHPStan\Analyser\NodeScopeResolver::processStmtNodes() is not covered by backward compatibility promise. The method might change in a minor PHPStan version.
+58: Asking about instanceof PHPStan\Analyser\MutatingScope is not covered by backward compatibility promise. The class might change in a minor PHPStan version. Full report
|
@vojtech-dobes After the latest push in 1.9.x, PHPStan now reports different result with your code snippet: @@ @@
+PHP 8.1 (1 error)
+==========
+
58: Asking about instanceof PHPStan\Analyser\MutatingScope is not covered by backward compatibility promise. The class might change in a minor PHPStan version.
-60: Calling PHPStan\Analyser\NodeScopeResolver::processStmtNodes() is not covered by backward compatibility promise. The method might change in a minor PHPStan version.
+
+PHP 7.4 – 8.0 (4 errors)
+==========
+
+ 7: Property ImmediatelyCalledClosureInMethodCallThrowTypeExtension::$nodeScopeResolver has unknown class PHPStan\Analyser\NodeScopeResolver as its type.
+18: Parameter $nodeScopeResolver of method ImmediatelyCalledClosureInMethodCallThrowTypeExtension::__construct() has invalid type PHPStan\Analyser\NodeScopeResolver.
+58: Asking about instanceof PHPStan\Analyser\MutatingScope is not covered by backward compatibility promise. The class might change in a minor PHPStan version.
+60: Call to method processStmtNodes() on an unknown class PHPStan\Analyser\NodeScopeResolver.
+
+PHP 7.1 – 7.3 (7 errors)
+==========
+
+ 7: Property ImmediatelyCalledClosureInMethodCallThrowTypeExtension::$nodeScopeResolver has unknown class PHPStan\Analyser\NodeScopeResolver as its type.
+18: Parameter $nodeScopeResolver of method ImmediatelyCalledClosureInMethodCallThrowTypeExtension::__construct() has invalid type PHPStan\Analyser\NodeScopeResolver.
+35: Call to method getName() on an unknown class PHPStan\Reflection\ClassReflection.
+58: Class PHPStan\Analyser\MutatingScope not found.
+60: Call to method processStmtNodes() on an unknown class PHPStan\Analyser\NodeScopeResolver.
+63: Call to method enterAnonymousFunction() on an unknown class PHPStan\Analyser\MutatingScope.
+83: Call to static method union() on an unknown class PHPStan\Type\TypeCombinator. Full reportPHP 8.1 (1 error)
PHP 7.4 – 8.0 (4 errors)
PHP 7.1 – 7.3 (7 errors)
|
@ondrejmirtes After the latest push in 1.9.x, PHPStan now reports different result with your code snippet: @@ @@
+PHP 8.1 (1 error)
+==========
+
58: Asking about instanceof PHPStan\Analyser\MutatingScope is not covered by backward compatibility promise. The class might change in a minor PHPStan version.
-60: Calling PHPStan\Analyser\NodeScopeResolver::processStmtNodes() is not covered by backward compatibility promise. The method might change in a minor PHPStan version.
+
+PHP 7.4 – 8.0 (4 errors)
+==========
+
+ 7: Property ImmediatelyCalledClosureInMethodCallThrowTypeExtension::$nodeScopeResolver has unknown class PHPStan\Analyser\NodeScopeResolver as its type.
+18: Parameter $nodeScopeResolver of method ImmediatelyCalledClosureInMethodCallThrowTypeExtension::__construct() has invalid type PHPStan\Analyser\NodeScopeResolver.
+58: Asking about instanceof PHPStan\Analyser\MutatingScope is not covered by backward compatibility promise. The class might change in a minor PHPStan version.
+60: Call to method processStmtNodes() on an unknown class PHPStan\Analyser\NodeScopeResolver.
+
+PHP 7.1 – 7.3 (7 errors)
+==========
+
+ 7: Property ImmediatelyCalledClosureInMethodCallThrowTypeExtension::$nodeScopeResolver has unknown class PHPStan\Analyser\NodeScopeResolver as its type.
+18: Parameter $nodeScopeResolver of method ImmediatelyCalledClosureInMethodCallThrowTypeExtension::__construct() has invalid type PHPStan\Analyser\NodeScopeResolver.
+35: Call to method getName() on an unknown class PHPStan\Reflection\ClassReflection.
+58: Class PHPStan\Analyser\MutatingScope not found.
+60: Call to method processStmtNodes() on an unknown class PHPStan\Analyser\NodeScopeResolver.
+63: Call to method enterAnonymousFunction() on an unknown class PHPStan\Analyser\MutatingScope.
+83: Call to static method union() on an unknown class PHPStan\Type\TypeCombinator. Full reportPHP 8.1 (1 error)
PHP 7.4 – 8.0 (4 errors)
PHP 7.1 – 7.3 (7 errors)
|
Bug report
MethodCallThrowTypeExtension
started to complain aboutMutatingScope
not being covered by backward compatibility promise.I would like to know how to modify the code to avoid this warning.
Code snippet that reproduces the problem
https://phpstan.org/r/5fd1150d-a3e3-478d-af2b-a7b82a4d9193
Expected output
No error reported.
Did PHPStan help you today? Did it make you happy in any way?
It transformed the way we work in PHP, it has incredibly positive impact on our productivity at ContentKing.
The text was updated successfully, but these errors were encountered: