push and unshift create arrays if their target isn't set

This commit is contained in:
Joby Elliott 2018-08-30 12:38:30 -06:00
parent 9594e5b804
commit b29504655d

View file

@ -33,6 +33,9 @@ trait FlatArrayTrait
if ($arr !== null && !is_array($arr)) {
return;
}
if ($arr === null) {
$arr = [];
}
array_unshift($arr, $value);
$this->set($name, $arr);
}