-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2e0fc2
commit bf3fa96
Showing
22 changed files
with
296 additions
and
421 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?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; | ||
} | ||
} else { | ||
$a[$key] = $value; | ||
} | ||
} | ||
|
||
return $a; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?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]> | ||
*/ | ||
class CachingLoader | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?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; | ||
|
||
use Phoundation\Config\Config; | ||
|
||
/** | ||
* @author Nikola Posa <[email protected]> | ||
*/ | ||
interface ConfigLoaderInterface | ||
{ | ||
public function __invoke() : Config; | ||
} |
Oops, something went wrong.