Inject/Injector.php
public function apply(array $params,$value_given = array()){
        $result = array();
        foreach ($params as $param){
            if(key_exists($param->name,$value_given)){
                $result[] = $value_given[$param->name];
            }else{
                $class = $param->getClass();
                $name_to_produce = is_null($class) ? $param->name : $class->name;
                try{
                    $temp = $this->produce($name_to_produce,array(),false);
                }catch (InjectorException $e){
                    if($param->isDefaultValueAvailable()){
                        $temp = $param->getDefaultValue();
                    }else{
                        throw $e;
                    }
                }
                $result[] = $temp;
            }
        }
        return $result;
    }
public function apply(array $params,$value_given = array()){
        $result = array();
        foreach ($params as $param){
            if(key_exists($param->name,$value_given)){
                $result[] = $value_given[$param->name];
            }else{
                $class = $param->getClass();
                $name_to_produce = is_null($class) ? $param->name : $class->name;
                try{
                    $temp = $this->produce($name_to_produce,array(),false);
                }catch (InjectorException $e){
                    if($param->isDefaultValueAvailable()){
                        $temp = $param->getDefaultValue();
                    }else{
                        throw $e;
                    }
                }
                $result[] = $temp;
            }
        }
        return $result;
    }
public function apply ( array $ params , $ value_given = array ( ) ) { $ result = array ( ) ; foreach ( $ params as $ param ) { if ( key_exists ( $ param -> name , $ value_given ) ) { $ result [ ] = $ value_given [ $ param -> name ] ; } else { $ class = $ param -> getClass ( ) ; $ name_to_produce = is_null ( $ class ) ? $ param -> name : $ class -> name ; try { $ temp = $ this -> produce ( $ name_to_produce , array ( ) , false ) ; } catch ( InjectorException $ e ) { if ( $ param -> isDefaultValueAvailable ( ) ) { $ temp = $ param -> getDefaultValue ( ) ; } else { throw $ e ; } } $ result [ ] = $ temp ; } } return $ result ; }
fill the params(keys) by the values given and objects in Injector container
@param array $params
@param array $value_given
@return array
@throws InjectorException
fill the params ( keys ) by the values given and objects in Injector container