diff --git a/src/Reflection/SignatureMap/Php8SignatureMapProvider.php b/src/Reflection/SignatureMap/Php8SignatureMapProvider.php index 86be50426a..dafe54880d 100644 --- a/src/Reflection/SignatureMap/Php8SignatureMapProvider.php +++ b/src/Reflection/SignatureMap/Php8SignatureMapProvider.php @@ -124,10 +124,6 @@ public function getMethodSignature(string $className, string $methodName, ?\Refl return $this->functionSignatureMapProvider->getMethodSignature($className, $methodName, $reflectionMethod, $variant); } - if ($this->functionSignatureMapProvider->hasMethodSignature($className, $methodName, 1)) { - return $this->functionSignatureMapProvider->getMethodSignature($className, $methodName, $reflectionMethod, $variant); - } - $methodNode = $this->findMethodNode($className, $methodName); if ($methodNode === null) { return $this->functionSignatureMapProvider->getMethodSignature($className, $methodName, $reflectionMethod, $variant); @@ -157,10 +153,6 @@ public function getFunctionSignature(string $functionName, ?string $className, i return $this->functionSignatureMapProvider->getFunctionSignature($functionName, $className, $variant); } - if ($this->functionSignatureMapProvider->hasFunctionSignature($functionName, 1)) { - return $this->functionSignatureMapProvider->getFunctionSignature($functionName, $className, $variant); - } - $stubFile = self::DIRECTORY . '/' . Php8StubsMap::FUNCTIONS[$lowerName]; $nodes = $this->fileNodesFetcher->fetchNodes($stubFile); $functions = $nodes->getFunctionNodes(); diff --git a/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php b/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php index bc4ec5d142..50ec75ce8c 100644 --- a/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php +++ b/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php @@ -470,4 +470,9 @@ public function testNamedArguments(): void $this->analyse([__DIR__ . '/data/named-arguments.php'], $errors); } + public function testBug4514(): void + { + $this->analyse([__DIR__ . '/data/bug-4514.php'], []); + } + } diff --git a/tests/PHPStan/Rules/Functions/data/bug-4514.php b/tests/PHPStan/Rules/Functions/data/bug-4514.php new file mode 100644 index 0000000000..9f53ecb0f6 --- /dev/null +++ b/tests/PHPStan/Rules/Functions/data/bug-4514.php @@ -0,0 +1,6 @@ +