protected function resolveParameters(
        $class,
        array $unresolvedParameters,
        array $primitives
    ) : array {
        $resolvedParameters = [];

        foreach ($unresolvedParameters as $parameter) {
            $resolvedParameter = null;

            if ($parameter->getClass() === null) {
                // The parameter is a primitive
                $resolvedParameter = $this->resolvePrimitive($parameter, $primitives);
            } else {
                // The parameter is an object
                $parameterClassName = $parameter->getClass()->getName();

                /**
                 * We need to first check if the input class is a target for the parameter
                 * If it is, resolve it using the input class as a target
                 * Otherwise, attempt to resolve it universally
                 */
                if ($class !== null && $this->hasTargetedBinding($parameterClassName, $class)) {
                    $resolvedParameter = $this->for($class, function (IContainer $container) use ($parameter) {
                        return $container->resolve($parameter->getClass()->getName());
                    });
                } else {
                    $resolvedParameter = $this->resolve($parameterClassName);
                }
            }

            $resolvedParameters[] = $resolvedParameter;
        }

        return $resolvedParameters;
    }
protected function resolveParameters(
        $class,
        array $unresolvedParameters,
        array $primitives
    ) : array {
        $resolvedParameters = [];

        foreach ($unresolvedParameters as $parameter) {
            $resolvedParameter = null;

            if ($parameter->getClass() === null) {
                // The parameter is a primitive
                $resolvedParameter = $this->resolvePrimitive($parameter, $primitives);
            } else {
                // The parameter is an object
                $parameterClassName = $parameter->getClass()->getName();

                /**
                 * We need to first check if the input class is a target for the parameter
                 * If it is, resolve it using the input class as a target
                 * Otherwise, attempt to resolve it universally
                 */
                if ($class !== null && $this->hasTargetedBinding($parameterClassName, $class)) {
                    $resolvedParameter = $this->for($class, function (IContainer $container) use ($parameter) {
                        return $container->resolve($parameter->getClass()->getName());
                    });
                } else {
                    $resolvedParameter = $this->resolve($parameterClassName);
                }
            }

            $resolvedParameters[] = $resolvedParameter;
        }

        return $resolvedParameters;
    }
protected function resolveParameters ( $ class , array $ unresolvedParameters , array $ primitives ) : array { $ resolvedParameters = [ ] ; foreach ( $ unresolvedParameters as $ parameter ) { $ resolvedParameter = null ; if ( $ parameter -> getClass ( ) === null ) { // The parameter is a primitive $ resolvedParameter = $ this -> resolvePrimitive ( $ parameter , $ primitives ) ; } else { // The parameter is an object $ parameterClassName = $ parameter -> getClass ( ) -> getName ( ) ; /**
                 * We need to first check if the input class is a target for the parameter
                 * If it is, resolve it using the input class as a target
                 * Otherwise, attempt to resolve it universally
                 */ if ( $ class !== null && $ this -> hasTargetedBinding ( $ parameterClassName , $ class ) ) { $ resolvedParameter = $ this -> for ( $ class , function ( IContainer $ container ) use ( $ parameter ) { return $ container -> resolve ( $ parameter -> getClass ( ) -> getName ( ) ) ; } ) ; } else { $ resolvedParameter = $ this -> resolve ( $ parameterClassName ) ; } } $ resolvedParameters [ ] = $ resolvedParameter ; } return $ resolvedParameters ; }
Resolves a list of parameters for a function call

@param string|null $class The name of the class whose parameters we're resolving
@param ReflectionParameter[] $unresolvedParameters The list of unresolved parameters
@param array $primitives The list of primitive values
@return array The list of parameters with all the dependencies resolved
@throws IocException Thrown if there was an error resolving the parameters
Resolves a list of parameters for a function call