mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 12:24:49 +01:00
Fix using std library functions
This commit is contained in:
parent
9e41905171
commit
ebc8b613de
@ -628,7 +628,7 @@ class ArgumentsAnalyzer
|
|||||||
for ($i = $argument_offset; $i < $function_param_count; $i++) {
|
for ($i = $argument_offset; $i < $function_param_count; $i++) {
|
||||||
$arg_function_params[$argument_offset][] = $function_params[$i];
|
$arg_function_params[$argument_offset][] = $function_params[$i];
|
||||||
}
|
}
|
||||||
} elseif ($arg->name && $function_storage && $function_storage->allow_named_arg_calls) {
|
} elseif ($arg->name && (!$function_storage || $function_storage->allow_named_arg_calls)) {
|
||||||
foreach ($function_params as $candidate_param) {
|
foreach ($function_params as $candidate_param) {
|
||||||
if ($candidate_param->name === $arg->name->name || $candidate_param->is_variadic) {
|
if ($candidate_param->name === $arg->name->name || $candidate_param->is_variadic) {
|
||||||
$arg_function_params[$argument_offset] = [$candidate_param];
|
$arg_function_params[$argument_offset] = [$candidate_param];
|
||||||
|
@ -273,6 +273,13 @@ class ArgTest extends TestCase
|
|||||||
bar(...["aaaaa"]);
|
bar(...["aaaaa"]);
|
||||||
function bar(string $p1, int $p3 = 10) : void {}'
|
function bar(string $p1, int $p3 = 10) : void {}'
|
||||||
],
|
],
|
||||||
|
'mkdirNamedParameters' => [
|
||||||
|
'<?php declare(strict_types=1);
|
||||||
|
mkdir("/var/test/123", recursive: true);',
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
'8.0'
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user