From cd2dc5e8190d7e145fe09d39882713d8a19d9917 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:13:01 +0200 Subject: [PATCH] fix for numeric keys --- src/DiContainerTrait.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/DiContainerTrait.php b/src/DiContainerTrait.php index 511783ec..290c8dfb 100644 --- a/src/DiContainerTrait.php +++ b/src/DiContainerTrait.php @@ -50,6 +50,12 @@ trait DiContainerTrait public function setDefaults(array $properties, bool $passively = false) { foreach ($properties as $key => $val) { + if (is_numeric($key)) { + $this->setMissingProperty($key, $val); + + continue; + } + $getterName = 'get' . ucfirst($key); $setterName = 'set' . ucfirst($key); $setterExists = method_exists($this, $setterName);