mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Merge pull request #7321 from weirdan/dont-crash-on-array_map-first-class-callable
This commit is contained in:
commit
46bcb626f5
@ -125,6 +125,10 @@ class ExpressionScanner
|
||||
}
|
||||
}
|
||||
|
||||
if ($node->isFirstClassCallable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($function_id === 'define') {
|
||||
$first_arg_value = isset($node->getArgs()[0]) ? $node->getArgs()[0]->value : null;
|
||||
$second_arg_value = isset($node->getArgs()[1]) ? $node->getArgs()[1]->value : null;
|
||||
|
@ -729,6 +729,12 @@ class ClosureTest extends TestCase
|
||||
[],
|
||||
'8.1'
|
||||
],
|
||||
'FirstClassCallable:array_map' => [
|
||||
'<?php call_user_func(array_map(...), intval(...), ["1"]);',
|
||||
'assertions' => [],
|
||||
[],
|
||||
'8.1',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@ -1171,9 +1177,8 @@ class ClosureTest extends TestCase
|
||||
'error_message' => 'MixedAssignment',
|
||||
[],
|
||||
false,
|
||||
'8.1'
|
||||
'8.1',
|
||||
],
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user