protected function resolveDependencies(array $dependencies, array $parameters = [])
    {
        $results = [];
        foreach ($dependencies as $dependency) {
            if (array_key_exists($dependency->name, $parameters)) { // Parameter value is given
                $results[] = $parameters[$dependency->name];
            } else { // Parameter value is not given
                $results[] = is_null($class = $dependency->getClass())
                    ? $dependency->getDefaultValue()
                    : $this->getInstance($dependency->getClass()->name);
            }
        }

        return $results;
    }
protected function resolveDependencies(array $dependencies, array $parameters = [])
    {
        $results = [];
        foreach ($dependencies as $dependency) {
            if (array_key_exists($dependency->name, $parameters)) { // Parameter value is given
                $results[] = $parameters[$dependency->name];
            } else { // Parameter value is not given
                $results[] = is_null($class = $dependency->getClass())
                    ? $dependency->getDefaultValue()
                    : $this->getInstance($dependency->getClass()->name);
            }
        }

        return $results;
    }
protected function resolveDependencies ( array $ dependencies , array $ parameters = [ ] ) { $ results = [ ] ; foreach ( $ dependencies as $ dependency ) { if ( array_key_exists ( $ dependency -> name , $ parameters ) ) { // Parameter value is given $ results [ ] = $ parameters [ $ dependency -> name ] ; } else { // Parameter value is not given $ results [ ] = is_null ( $ class = $ dependency -> getClass ( ) ) ? $ dependency -> getDefaultValue ( ) : $ this -> getInstance ( $ dependency -> getClass ( ) -> name ) ; } } return $ results ; }
Resolves dependencies recursively
@param array $dependencies List of dependencies
@param array $parameters Fill parameter slots with pre-given data
@return array The resolved dependencies
@since 1.0.0
Resolves dependencies recursively