From 5a870d521497402d1edb7bf9c449c6bd15fb12d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 13 Jun 2020 01:17:26 +0200 Subject: [PATCH] fix possible recursion --- src/DiContainerTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {