Skip to content

Commit

Permalink
[Fix] keep build logs directory
Browse files Browse the repository at this point in the history
  • Loading branch information
bumbummen99 committed Nov 29, 2024
1 parent 6c9afac commit f522c41
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ composer.phar
# PHPUnit
.phpunit.result.cache
coverage/
build/logs/
build/logs/*
!build/logs/.gitkeep
Empty file added build/logs/.gitkeep
Empty file.
20 changes: 11 additions & 9 deletions src/GameQ/Helpers/Arr.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,20 @@ public static function recursively(array $data, Closure $callback)
$data,
$recursiveIterator,
$subIterator,
/* Update the current value */
fn () => $subIterator->offsetSet(
/* Keep the original key */
$key,
/* Execute the callback and use the return / modified value */
$callback($value, $key, $subIterator) ?? $value
)
function () use ($callback, &$value, $key, $subIterator) {
/* Update the current value */
$subIterator->offsetSet(
/* Keep the original key */
$key,
/* Execute the callback and use the return / modified value */
$callback($value, $key, $subIterator) ?? $value
);
}
);
}

/* Return the processed data */
return $data;
return $arrayIterator->getArrayCopy();
}

/**
Expand Down Expand Up @@ -106,7 +108,7 @@ protected static function handleArrayIteratorCopyOrReference(
/* Process all modified values */
foreach (array_keys($diff) as $modified) {
/* Write the modified value to the original array */
$data = static::set($data, [...$path, $modified], $iterator->offsetGet($modified));
static::set($data, array_merge($path, [$modified]), $iterator->offsetGet($modified));
}
}
} else {
Expand Down

0 comments on commit f522c41

Please sign in to comment.