protected function resolveParameter(ReflectionParameter $parameter, array $parameters = [])
    {
        $name  = $parameter->name;
        $index = $parameter->getPosition();

        if (isset($parameters[$name])) {
            return $parameters[$name];
        }

        if (isset($parameters[$index])) {
            return $parameters[$index];
        }

        if ($class = $parameter->getClass()) {
            return $this->resolve($class->name);
        }

        if ($parameter->isDefaultValueAvailable()) {
            return $parameter->getDefaultValue();
        }

        throw new BindingResolutionException(\sprintf(
            'Unresolvable dependency resolving [%s] in [%s]',
            $parameter,
            \end($this->buildStack)
        ));
    }
protected function resolveParameter(ReflectionParameter $parameter, array $parameters = [])
    {
        $name  = $parameter->name;
        $index = $parameter->getPosition();

        if (isset($parameters[$name])) {
            return $parameters[$name];
        }

        if (isset($parameters[$index])) {
            return $parameters[$index];
        }

        if ($class = $parameter->getClass()) {
            return $this->resolve($class->name);
        }

        if ($parameter->isDefaultValueAvailable()) {
            return $parameter->getDefaultValue();
        }

        throw new BindingResolutionException(\sprintf(
            'Unresolvable dependency resolving [%s] in [%s]',
            $parameter,
            \end($this->buildStack)
        ));
    }
protected function resolveParameter ( ReflectionParameter $ parameter , array $ parameters = [ ] ) { $ name = $ parameter -> name ; $ index = $ parameter -> getPosition ( ) ; if ( isset ( $ parameters [ $ name ] ) ) { return $ parameters [ $ name ] ; } if ( isset ( $ parameters [ $ index ] ) ) { return $ parameters [ $ index ] ; } if ( $ class = $ parameter -> getClass ( ) ) { return $ this -> resolve ( $ class -> name ) ; } if ( $ parameter -> isDefaultValueAvailable ( ) ) { return $ parameter -> getDefaultValue ( ) ; } throw new BindingResolutionException ( \ sprintf ( 'Unresolvable dependency resolving [%s] in [%s]' , $ parameter , \ end ( $ this -> buildStack ) ) ) ; }
Resolve a parameter.

@param \ReflectionParameter $parameter
@param array                $parameters

@throws \Viserio\Component\Contract\Container\Exception\BindingResolutionException
@throws \Viserio\Component\Contract\Container\Exception\CyclicDependencyException

@return mixed
Resolve a parameter .