Skip to content

Commit f1af6f8

Browse files
committed
Fix phpstan
1 parent 482fbfa commit f1af6f8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

rules/TypeDeclaration/NodeAnalyzer/CallTypesResolver.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ public function resolveStrictTypesFromCalls(array $calls): array
4040
$staticTypesByArgumentPosition = [];
4141

4242
foreach ($calls as $call) {
43-
foreach ($call->args as $position => $arg) {
43+
if ($call->isFirstClassCallable()) {
44+
return [];
45+
}
46+
47+
foreach ($call->getArgs() as $position => $arg) {
4448
if ($this->shouldSkipArg($arg)) {
4549
return [];
4650
}
@@ -200,15 +204,11 @@ private function normalizeType(Type $argValueType): MixedType|ObjectType|Type
200204
}
201205

202206
/**
203-
* There is first class callable usage, or argument unpack, or named expr
207+
* There is argument unpack, or named expr
204208
* simply returns array marks as unknown as can be anything and in any position
205209
*/
206-
private function shouldSkipArg(Arg|VariadicPlaceholder $arg): bool
210+
private function shouldSkipArg(Arg $arg): bool
207211
{
208-
if ($arg instanceof VariadicPlaceholder) {
209-
return true;
210-
}
211-
212212
if ($arg->unpack) {
213213
return true;
214214
}

0 commit comments

Comments
 (0)