push and unshift create arrays if their target isn't set
This commit is contained in:
parent
9594e5b804
commit
b29504655d
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue