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
Unify specifyOnly and rootExpr into single rootExpr mechanism with duplicate detection
Replace the `specifyOnly` flag with `rootExpr` + a sureType for the call
expression in both StrContainingTypeSpecifyingExtension and
ArrayKeyExistsFunctionTypeSpecifyingExtension. This unifies their behavior
with equality assertions (`@phpstan-assert-if-true =Type`), which already
use rootExpr.
Add duplicate call detection: when a function/method call with rootExpr
has already been evaluated in scope (via hasExpressionType), report the
nested identical call as always-true. This works for str_contains,
str_ends_with, array_key_exists, and equality assertion methods.
For equality assertions, add the call itself as a sureType with
ConstantBooleanType so it gets stored in scope's expressionTypes,
enabling the same duplicate detection.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
'Call to function str_ends_with() with non-empty-string and non-empty-string will always evaluate to true.',
516
+
75,
517
+
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
518
+
],
519
+
[
520
+
'Call to function str_contains() with non-empty-string and non-empty-string will always evaluate to true.',
521
+
87,
522
+
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
'Call to method Bug14705\Foo::isValid() with non-empty-string will always evaluate to true.',
317
+
104,
318
+
'If Bug14705\Foo::isValid() is impure, add <fg=cyan>@phpstan-impure</> PHPDoc tag above its declaration. Learn more: <fg=cyan>https://phpstan.org/blog/remembering-and-forgetting-returned-values</>',
0 commit comments