protected function mergeConfiguration(array $global, array $builder)
    {
        foreach ($global as $name => &$value) {
            if (!array_key_exists($name, $builder) || is_null($builder[$name])) {
                continue;
            }

            if (!is_array($value)) {
                $value = $builder[$name];

                continue;
            }

            if (!is_array($builder[$name])) {
                throw new \InvalidArgumentException('Invalid generator');
            }

            $value = array_replace($value, $builder[$name]);
        }

        return array_merge($global, array_diff_key($builder, $global));
    }
protected function mergeConfiguration(array $global, array $builder)
    {
        foreach ($global as $name => &$value) {
            if (!array_key_exists($name, $builder) || is_null($builder[$name])) {
                continue;
            }

            if (!is_array($value)) {
                $value = $builder[$name];

                continue;
            }

            if (!is_array($builder[$name])) {
                throw new \InvalidArgumentException('Invalid generator');
            }

            $value = array_replace($value, $builder[$name]);
        }

        return array_merge($global, array_diff_key($builder, $global));
    }
protected function mergeConfiguration ( array $ global , array $ builder ) { foreach ( $ global as $ name => & $ value ) { if ( ! array_key_exists ( $ name , $ builder ) || is_null ( $ builder [ $ name ] ) ) { continue ; } if ( ! is_array ( $ value ) ) { $ value = $ builder [ $ name ] ; continue ; } if ( ! is_array ( $ builder [ $ name ] ) ) { throw new \ InvalidArgumentException ( 'Invalid generator' ) ; } $ value = array_replace ( $ value , $ builder [ $ name ] ) ; } return array_merge ( $ global , array_diff_key ( $ builder , $ global ) ) ; }
Merge configuration on a single level

@param  array $global
@param  array $builder

@return array
Merge configuration on a single level