You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix method_exists() with string literal not narrowing static method calls
- When method_exists() receives a string literal class name (not ClassName::class),
the type narrowing was only applied to the string expression, not to the equivalent
ClassConstFetch expression that StaticMethodCallCheck uses
- Added logic in MethodExistsTypeSpecifyingExtension to also narrow the ClassConstFetch
expression when the first argument is a string literal that is a class-string
- New regression tests in tests/PHPStan/Rules/Methods/data/bug-9592.php and
tests/PHPStan/Analyser/nsrt/bug-9592.php
Closesphpstan/phpstan#9592
0 commit comments