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
PHPStan seems to stop parsing as soon as it has a consistent type and ignores the following chars as detected in composer/semver#128
While not a bug per se, it allows weird syntax to go undetected and can lead to serious issues in debugging (see snippet below)
In the example below, a simple typo will lead to very unclear error. The type is not valid, but instead of complaining about it, PHPStan will report an error on the return 0; because it stopped reading the type before reaching |int
Note that this is not an issue in a @param because PHPStan expects the variable name at the end of the line
Thanks!
The text was updated successfully, but these errors were encountered:
Bug report
PHPStan seems to stop parsing as soon as it has a consistent type and ignores the following chars as detected in composer/semver#128
While not a bug per se, it allows weird syntax to go undetected and can lead to serious issues in debugging (see snippet below)
Code snippet that reproduces the problem
https://phpstan.org/r/6a8372a5-0f20-4469-a134-0807a15d3e6c
Expected output
In the example below, a simple typo will lead to very unclear error. The type is not valid, but instead of complaining about it, PHPStan will report an error on the
return 0;
because it stopped reading the type before reaching|int
Note that this is not an issue in a @param because PHPStan expects the variable name at the end of the line
Thanks!
The text was updated successfully, but these errors were encountered: