Skip to content

Commit

Permalink
fix for numeric keys
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Aug 26, 2020
1 parent 40a1f8f commit cd2dc5e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/DiContainerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cd2dc5e

Please sign in to comment.