src/Resolver.php
private function getParameterValue(string $id, ReflectionParameter $parameter, ContainerInterface $container)
    {
        if (! ($class = $parameter->getClass())) {
            if ($parameter->isDefaultValueAvailable()) {
                // a default value is available so use that
                return $parameter->getDefaultValue();
            }

            // no default, eek
            throw new FatalNotFoundException("Cannot resolve '" . $parameter->getName() . "' for class '" . $id . "'");
        }

        try {
            // attempt to resolve the value
            return $container->get($class->getName());
        } catch (NotFoundException $e) {
            if ($parameter->isDefaultValueAvailable()) {
                // a default value is available so use that
                return $parameter->getDefaultValue();
            }
            throw $e;
        }
    }
private function getParameterValue(string $id, ReflectionParameter $parameter, ContainerInterface $container)
    {
        if (! ($class = $parameter->getClass())) {
            if ($parameter->isDefaultValueAvailable()) {
                // a default value is available so use that
                return $parameter->getDefaultValue();
            }

            // no default, eek
            throw new FatalNotFoundException("Cannot resolve '" . $parameter->getName() . "' for class '" . $id . "'");
        }

        try {
            // attempt to resolve the value
            return $container->get($class->getName());
        } catch (NotFoundException $e) {
            if ($parameter->isDefaultValueAvailable()) {
                // a default value is available so use that
                return $parameter->getDefaultValue();
            }
            throw $e;
        }
    }
private function getParameterValue ( string $ id , ReflectionParameter $ parameter , ContainerInterface $ container ) { if ( ! ( $ class = $ parameter -> getClass ( ) ) ) { if ( $ parameter -> isDefaultValueAvailable ( ) ) { // a default value is available so use that return $ parameter -> getDefaultValue ( ) ; } // no default, eek throw new FatalNotFoundException ( "Cannot resolve '" . $ parameter -> getName ( ) . "' for class '" . $ id . "'" ) ; } try { // attempt to resolve the value return $ container -> get ( $ class -> getName ( ) ) ; } catch ( NotFoundException $ e ) { if ( $ parameter -> isDefaultValueAvailable ( ) ) { // a default value is available so use that return $ parameter -> getDefaultValue ( ) ; } throw $ e ; } }
Get the parameter value

@param string $id
@param ReflectionParameter $parameter
@param ContainerInterface $container
@return mixed
Get the parameter value