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