Skip to content

Commit

Permalink
Resolver: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Feb 27, 2023
1 parent 8e6357f commit a9f2875
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/DI/Resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -555,13 +555,9 @@ public static function autowireArguments(
$optCount = 0;
break;

} elseif (array_key_exists($paramName, $arguments)) {
$res[$useName ? $paramName : $num] = $arguments[$paramName];
unset($arguments[$paramName], $arguments[$num]);

} elseif (array_key_exists($num, $arguments)) {
$res[$useName ? $paramName : $num] = $arguments[$num];
unset($arguments[$num]);
} elseif (array_key_exists($key = $paramName, $arguments) || array_key_exists($key = $num, $arguments)) {
$res[$useName ? $paramName : $num] = $arguments[$key];
unset($arguments[$key], $arguments[$num]); // unset $num to enable overwriting in configuration

} elseif (($aw = self::autowireArgument($param, $getter)) !== null) {
$res[$useName ? $paramName : $num] = $aw;
Expand Down

0 comments on commit a9f2875

Please sign in to comment.