Skip to content

Commit

Permalink
Merge pull request #6 from SergiX44/analysis-yr0krp
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
sergix44 authored Jun 30, 2023
2 parents 943d7c4 + 4407fe9 commit dcae4bb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,10 @@ protected function getArguments(array $parameters, $additional = []): array

return match (true) {
$type !== null && $this->has($type) => $this->get($type), // via definitions
array_key_exists($param->getName(),
$additional) => $additional[$param->getName()], // defined by the user
array_key_exists(
$param->getName(),
$additional
) => $additional[$param->getName()], // defined by the user
!empty($positionalArgs) => array_shift($positionalArgs),
$param->isOptional() => $param->getDefaultValue(), // use default when available
$type !== null && class_exists($type) && !enum_exists($type) => $this->resolve($type), // via reflection
Expand Down

0 comments on commit dcae4bb

Please sign in to comment.