Skip to content

Commit

Permalink
Merge branch 'master' into fix-union
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik authored Dec 16, 2024
2 parents 12667a1 + 0a67ef0 commit 985ffaf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 3.3.1 under development

- Bug #100: Fix resolving `ParameterDefinition` for optional parameters with union types (@vjik)
- Enh #101: Minor performance improvement by removing 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 985ffaf

Please sign in to comment.