diff --git a/src/DiContainerTrait.php b/src/DiContainerTrait.php index 290c8dfb..9b6ef22f 100644 --- a/src/DiContainerTrait.php +++ b/src/DiContainerTrait.php @@ -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) {