Skip to content
Permalink
Browse files

Fix #2479 - analyse undefined function arguments too

  • Loading branch information
muglug committed Dec 18, 2019
1 parent fb85b81 commit 9d8ca08fb98db0deb151ff1f1403feec706fc9f5
@@ -338,6 +338,16 @@ public static function analyze(
$is_maybe_root_function
) === false
) {
if (self::checkFunctionArguments(
$statements_analyzer,
$stmt->args,
null,
null,
$context
) === false) {
// fall through
}

return;
}
}
@@ -1346,6 +1346,18 @@ function getA() : ?A {
if (!($a = getA()) || $a->foo()) {}'
],
'usedInUndefinedFunction' => [
'<?php
/**
* @psalm-suppress MixedInferredReturnType
* @psalm-suppress MixedReturnStatement
*/
function test(): string {
$s = "a";
/** @psalm-suppress UndefinedFunction */
return undefined_function($s);
}'
],
];
}

0 comments on commit 9d8ca08

Please sign in to comment.
You can’t perform that action at this time.