src/DependencyInjection/ServiceContainer.php
private function resolveParameter(\ReflectionParameter $param, array $args)
    {
        $className = $param->getClass();
        if ($className !== null) {
            return $this->make($className->getName());
        } elseif (isset($args[$param->getName()])) {
            return $args[$param->getName()];
        } elseif ($param->isOptional()) {
            return $param->getDefaultValue();
        } else {
            throw new ClassResolvingException('Cannot resolve Parameter #'.$param->getPosition()." '".$param->getName()."'");
        }
    }
private function resolveParameter(\ReflectionParameter $param, array $args)
    {
        $className = $param->getClass();
        if ($className !== null) {
            return $this->make($className->getName());
        } elseif (isset($args[$param->getName()])) {
            return $args[$param->getName()];
        } elseif ($param->isOptional()) {
            return $param->getDefaultValue();
        } else {
            throw new ClassResolvingException('Cannot resolve Parameter #'.$param->getPosition()." '".$param->getName()."'");
        }
    }
private function resolveParameter ( \ ReflectionParameter $ param , array $ args ) { $ className = $ param -> getClass ( ) ; if ( $ className !== null ) { return $ this -> make ( $ className -> getName ( ) ) ; } elseif ( isset ( $ args [ $ param -> getName ( ) ] ) ) { return $ args [ $ param -> getName ( ) ] ; } elseif ( $ param -> isOptional ( ) ) { return $ param -> getDefaultValue ( ) ; } else { throw new ClassResolvingException ( 'Cannot resolve Parameter #' . $ param -> getPosition ( ) . " '" . $ param -> getName ( ) . "'" ) ; } }
Resolves a ReflectionParameter.

@param \ReflectionParameter $param
@param array                $args
@return mixed|object
@throws \Exception
Resolves a ReflectionParameter .