for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Phoundation package.
*
* Copyright (c) Nikola Posa
* For full copyright and license information, please refer to the LICENSE file,
* located at the package root folder.
*/
declare(strict_types=1);
namespace Phoundation\Config\Loader;
* @author Nikola Posa <[email protected]>
abstract class AbstractLoader implements ConfigLoaderInterface
{
final protected static function arrayMerge(array $a, array $b) : array
foreach ($b as $key => $value) {
if (array_key_exists($key, $a)) {
if (is_int($key)) {
$a[] = $value;
} elseif (is_array($value) && is_array($a[$key])) {
$a[$key] = self::arrayMerge($a[$key], $value);
} else {
$a[$key] = $value;
}
return $a;