False complaint? #5171
-
|
Hello, what you think about this example: https://phpstan.org/r/2e495b6f-48a8-4a61-9c8a-8923352408f1 Is it false detection? I think phpstan should not complain about this since if Br, Miika |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi, PHPStan doesn't understand that You can narrow types the usual way described in the docs: https://phpstan.org/writing-php-code/narrowing-types |
Beta Was this translation helpful? Give feedback.
Hi, PHPStan doesn't understand that
mb_strlen((string) $out) < 5also filtersnull, that's pretty complicated code.You can narrow types the usual way described in the docs: https://phpstan.org/writing-php-code/narrowing-types