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
{{ message }}
Repository navigation
IntBackedEnum and StringBackedEnum constructor not taken in to account #11421
To be clear there isn't any improvements here, it's just that Enums aren't supported til PHP 8.1 and apparently the way phpstan baubles up parsing errors changed a bit.
@@ @@-PHP 8.1 – 8.3+PHP 8.1 – 8.3 (2 errors)
==========
-No errors+16: Call to static method NumberEnum::from() on a separate line has no effect.+19: Call to static method WordEnum::from() on a separate line has no effect.-PHP 7.2 – 8.0 (2 errors)+PHP 8.0 (4 errors)+==========++ 3: Syntax error, unexpected T_STRING on line 3+ 4: Syntax error, unexpected '{' on line 4+ 9: Syntax error, unexpected T_STRING on line 9+10: Syntax error, unexpected '{' on line 10++PHP 7.2 – 7.4 (2 errors)
==========
3: Syntax error, unexpected T_STRING on line 3
5: Syntax error, unexpected T_CASE on line 5
Full report
PHP 8.1 – 8.3 (2 errors)
Line
Error
16
Call to static method NumberEnum::from() on a separate line has no effect.
19
Call to static method WordEnum::from() on a separate line has no effect.
Activity
phpstan-bot commentedon Sep 15, 2024
@AJenbo After the latest push in 2.0.x, PHPStan now reports different result with your code snippet:
Full report
PHP 8.1 – 8.3
No errors
PHP 8.0 (4 errors)
Syntax error, unexpected T_STRING on line 3Syntax error, unexpected '{' on line 4Syntax error, unexpected T_STRING on line 9Syntax error, unexpected '{' on line 10PHP 7.2 – 7.4 (2 errors)
Syntax error, unexpected T_STRING on line 3Syntax error, unexpected T_CASE on line 5AJenbo commentedon Sep 15, 2024
To be clear there isn't any improvements here, it's just that Enums aren't supported til PHP 8.1 and apparently the way phpstan baubles up parsing errors changed a bit.
phpstan-bot commentedon Sep 14, 2026
@AJenbo After the latest push in 2.3.x, PHPStan now reports different result with your code snippet:
Full report
PHP 8.1 – 8.3 (2 errors)
Call to static method NumberEnum::from() on a separate line has no effect.Call to static method WordEnum::from() on a separate line has no effect.PHP 8.0 (4 errors)
Syntax error, unexpected T_STRING on line 3Syntax error, unexpected '{' on line 4Syntax error, unexpected T_STRING on line 9Syntax error, unexpected '{' on line 10PHP 7.2 – 7.4 (2 errors)
Syntax error, unexpected T_STRING on line 3Syntax error, unexpected T_CASE on line 5