diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php index bf3fd86c71e..f60bb7aaadb 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php @@ -1368,7 +1368,7 @@ private static function taintReturnType( ? ($method_storage->signature_return_type_location ?: $method_storage->location) : null; - if ($method_storage && $method_storage->pure) { + if ($method_storage && $method_storage->specialize_call) { $method_source = TaintNode::getForMethodReturn( (string) $method_id, $cased_method_id, diff --git a/tests/TaintTest.php b/tests/TaintTest.php index bbf481333cb..d3b0581568b 100644 --- a/tests/TaintTest.php +++ b/tests/TaintTest.php @@ -1717,4 +1717,36 @@ public function testImplodeExplode() : void $this->analyzeFile('somefile.php', new Context()); } + + public function testSpecializeStaticMethod() : void + { + $this->project_analyzer->trackTaintedInputs(); + + $this->addFile( + 'somefile.php', + 'analyzeFile('somefile.php', new Context()); + } }