Skip to content

Commit

Permalink
fix possible recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jun 13, 2020
1 parent 099431b commit fc1ba36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DIContainerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function setDefaults(array $properties, bool $passively = false)

$getterName = 'get' . ucfirst($key);
$setterName = 'set' . ucfirst($key);
$setterExists = method_exists($this, $setterName);
$setterExists = method_exists($this, $setterName) && $setterName !== 'setDefaults';

if ($setterExists || property_exists($this, $key)) {
if ($passively && ($setterExists ? $this->{$getterName}() : $this->{$key}) !== null) {
Expand Down

0 comments on commit fc1ba36

Please sign in to comment.