Skip to content

Commit

Permalink
phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed May 22, 2022
1 parent b2123ce commit 93bca34
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/NodeAnalyzer/ParamAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function isParamUsedInClassMethod(ClassMethod $classMethod, Param $param)
return false;
}

$arguments = $this->funcCallManipulator->extractArgumentsFromCompactFuncCall($node);
$arguments = $this->funcCallManipulator->extractArgumentsFromCompactFuncCalls([$node]);
return $this->nodeNameResolver->isNames($param, $arguments);
});
}
Expand Down
25 changes: 14 additions & 11 deletions src/NodeManipulator/FuncCallManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,25 @@ public function __construct(
}

/**
* @param FuncCall[] $compactFuncCalls
* @return string[]
*/
public function extractArgumentsFromCompactFuncCall(FuncCall $funcCall): array
public function extractArgumentsFromCompactFuncCalls(array $compactFuncCalls): array
{
$arguments = [];
foreach ($funcCall->args as $arg) {
if (! $arg instanceof Arg) {
continue;
foreach ($compactFuncCalls as $compactFuncCall) {
foreach ($compactFuncCall->args as $arg) {
if (! $arg instanceof Arg) {
continue;
}

$value = $this->valueResolver->getValue($arg->value);
if ($value === null) {
continue;
}

$arguments[] = $value;
}

$value = $this->valueResolver->getValue($arg->value);
if ($value === null) {
continue;
}

$arguments[] = $value;
}

return $arguments;
Expand Down

0 comments on commit 93bca34

Please sign in to comment.