src/Config.php
protected function mergeServiceConfig(string $name, string $class, array $config): array
    {
        $config = array_merge($this->getServiceDefaults(), $config);

        if (!class_exists($class) && !interface_exists($class)) {
            return $config;
        }

        if (false === $config['merge']) {
            return $config;
        }

        $tree = $this->getConfigTree();
        $parents = array_merge(class_implements($class), class_parents($class));
        foreach ($tree as $parent_config) {
            foreach ($parents as $parent) {
                if (isset($parent_config[$parent])) {
                    $config = array_replace_recursive($config, $parent_config[$parent]);
                }
            }

            if (isset($parent_config[$name])) {
                $config = array_replace_recursive($config, $parent_config[$name]);
            }
        }

        return $config;
    }
protected function mergeServiceConfig(string $name, string $class, array $config): array
    {
        $config = array_merge($this->getServiceDefaults(), $config);

        if (!class_exists($class) && !interface_exists($class)) {
            return $config;
        }

        if (false === $config['merge']) {
            return $config;
        }

        $tree = $this->getConfigTree();
        $parents = array_merge(class_implements($class), class_parents($class));
        foreach ($tree as $parent_config) {
            foreach ($parents as $parent) {
                if (isset($parent_config[$parent])) {
                    $config = array_replace_recursive($config, $parent_config[$parent]);
                }
            }

            if (isset($parent_config[$name])) {
                $config = array_replace_recursive($config, $parent_config[$name]);
            }
        }

        return $config;
    }
protected function mergeServiceConfig ( string $ name , string $ class , array $ config ) : array { $ config = array_merge ( $ this -> getServiceDefaults ( ) , $ config ) ; if ( ! class_exists ( $ class ) && ! interface_exists ( $ class ) ) { return $ config ; } if ( false === $ config [ 'merge' ] ) { return $ config ; } $ tree = $ this -> getConfigTree ( ) ; $ parents = array_merge ( class_implements ( $ class ) , class_parents ( $ class ) ) ; foreach ( $ tree as $ parent_config ) { foreach ( $ parents as $ parent ) { if ( isset ( $ parent_config [ $ parent ] ) ) { $ config = array_replace_recursive ( $ config , $ parent_config [ $ parent ] ) ; } } if ( isset ( $ parent_config [ $ name ] ) ) { $ config = array_replace_recursive ( $ config , $ parent_config [ $ name ] ) ; } } return $ config ; }
Find parent classes or interfaces and merge service configurations.
Find parent classes or interfaces and merge service configurations .