Skip to content

Commit

Permalink
Merge pull request #10601 from weirdan/do-not-validate-callable-argum…
Browse files Browse the repository at this point in the history
…ents-in-lenient-contexts
  • Loading branch information
weirdan committed Jan 29, 2024
2 parents 79b67f8 + 67a91e0 commit 872cf58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Expand Up @@ -1355,6 +1355,7 @@ private static function verifyExplicitParam(
} else {
if (!$param_type->hasString()
&& !$param_type->hasArray()
&& $context->check_functions
&& CallAnalyzer::checkFunctionExists(
$statements_analyzer,
$function_id,
Expand Down
8 changes: 8 additions & 0 deletions tests/FunctionCallTest.php
Expand Up @@ -1647,6 +1647,14 @@ function in_array($a, $b) {
}
}',
],
'callableArgumentWithFunctionExists' => [
'code' => <<<'PHP'
<?php
if (function_exists('foo')) {
register_shutdown_function('foo');
}
PHP,
],
'pregMatch' => [
'code' => '<?php
function takesInt(int $i) : void {}
Expand Down

0 comments on commit 872cf58

Please sign in to comment.