mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-09 13:38:41 +00:00
Create array if not existing
This commit is contained in:
parent
a022348e47
commit
a37dd5e792
|
|
@ -96,8 +96,16 @@ final class ArrayUtils
|
||||||
throw new \Exception();
|
throw new \Exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$pathPartCount = \count($pathParts);
|
||||||
|
$c = 1;
|
||||||
|
|
||||||
foreach ($pathParts as $key) {
|
foreach ($pathParts as $key) {
|
||||||
|
if (!isset($current[$key]) && $pathPartCount < $c) {
|
||||||
|
$current = [];
|
||||||
|
}
|
||||||
|
|
||||||
$current = &$current[$key];
|
$current = &$current[$key];
|
||||||
|
++$c;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($overwrite) {
|
if ($overwrite) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user