src/Parser/Rule/MergeDown.php
private function niceMerge(array &$source, array &$destination): array
    {
        $merged = $source;

        foreach ($destination as $key => &$value) {
            if (
                    $this->mergeRecursive &&
                    isset($merged[$key]) &&
                    is_array($merged[$key])
            ) {
                $merged[$key] = $this->niceMerge($source[$key], $value);
                continue;
            }

            $merged[$key] = $value;
        }

        return $merged;
    }
private function niceMerge(array &$source, array &$destination): array
    {
        $merged = $source;

        foreach ($destination as $key => &$value) {
            if (
                    $this->mergeRecursive &&
                    isset($merged[$key]) &&
                    is_array($merged[$key])
            ) {
                $merged[$key] = $this->niceMerge($source[$key], $value);
                continue;
            }

            $merged[$key] = $value;
        }

        return $merged;
    }
private function niceMerge ( array & $ source , array & $ destination ) : array { $ merged = $ source ; foreach ( $ destination as $ key => & $ value ) { if ( $ this -> mergeRecursive && isset ( $ merged [ $ key ] ) && is_array ( $ merged [ $ key ] ) ) { $ merged [ $ key ] = $ this -> niceMerge ( $ source [ $ key ] , $ value ) ; continue ; } $ merged [ $ key ] = $ value ; } return $ merged ; }
Recursive nice merge

@param array $source
@param array $destination
@return array
Recursive nice merge