for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Yiisoft\Composer\Config\Merger\Modifier;
/**
* Result will be ordered by source the opposite to actual merge.
* It is especially useful for merging module config with core config
* where more specific config has more priority.
*
* The modifier should be specified as
* ```php
* ReverseBlockMerge::class => new ReverseBlockMerge(),
* ```
* For example:
* $one = [
* 'f' => 'f1',
* 'b' => [
* 'b1' => 'b11',
* 'b2' => 'b33',
* ],
* 'g' => 'g1',
* 'h',
* ];
* $two = [
* 'a' => 'a1',
* 'b1' => 'bv1',
* 'b2' => 'bv2',
* 'd',
* $three = [
* 'a' => 'a2',
* 'c' => 'c1',
* 'b2' => 'bv22',
* 'b3' => 'bv3',
* 'e',
* $result = Merger::merge($one, $two, $three);
* Will result in:
* [
* ]
* 0 => 'e',
* 1 => 'd',
* 2 => 'h',
* @see Merger::performReverseBlockMerge()
*/
final class ReverseBlockMerge implements ModifierInterface
{
public function apply(array $data, $key): array
return $data;
}