From 3f78082720786ab79d9080a2dd3c6ebb8974a670 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Sat, 10 Aug 2019 09:16:32 -0400 Subject: [PATCH] Fix is_string call --- .../Analyzer/Statements/Expression/AssertionFinder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php b/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php index da5693bcd0f..b2e6e48853c 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php @@ -1861,7 +1861,7 @@ protected static function processCustomAssertion( $if_types[$var_id] = [[$prefix . $assertion->rule[0][0]]]; } } - } elseif (is_string($assertion->var_id) + } elseif (\is_string($assertion->var_id) && strpos($assertion->var_id, '$this->') === 0 && $expr instanceof PhpParser\Node\Expr\MethodCall ) { @@ -1910,7 +1910,7 @@ protected static function processCustomAssertion( $if_types[$var_id] = [[$negated_prefix . $assertion->rule[0][0]]]; } } - } elseif (is_string($assertion->var_id) + } elseif (\is_string($assertion->var_id) && strpos($assertion->var_id, '$this->') === 0 && $expr instanceof PhpParser\Node\Expr\MethodCall ) {