Skip to content

Commit

Permalink
Remove unnecessary code in DefinitionStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Dec 15, 2024
1 parent f8ebd40 commit d0b3be9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 3.3.1 under development

- no changes in this release.
- Enh #101: Minor performance improvement by remove unnecessary code in `DefinitionStorage` (@vjik)

## 3.3.0 March 16, 2024

Expand Down
3 changes: 2 additions & 1 deletion src/DefinitionStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ private function isResolvable(string $id, array $building): bool
$parameter = $dependency->getReflection();
$type = $parameter->getType();

if ($parameter->isVariadic() || $parameter->isOptional()) {
// This condition covers variadic parameters, because variadic parameter is optional
if ($parameter->isOptional()) {
/** @infection-ignore-all Mutation don't change behaviour, but degrade performance. */
break;
}
Expand Down

0 comments on commit d0b3be9

Please sign in to comment.