private function resolveParameters($parameters): array
    {
        // this will hold our dependencies information
        $dependencies = [];

        // Then loop through the parameters to see what is in the constructor.
        foreach ($parameters as $key => $parameter) {
            // Extract the class name to a dependency.
            $dependency = $parameter->getClass();

            // If it is null, then it is not a class, so we need to see if we've been
            // given a default value. If so, store the value for now.
            if (is_null($dependency)) {
                if ($parameter->isDefaultValueAvailable()) {
                    $dependencies[$key]['type'] = 'default';
                    $dependencies[$key]['value'] = $parameter->getDefaultValue();
                } else {
                    throw new ContainerException('Non class dependency ('.$parameter->name.') requires default value.');
                }
            }
            // Otherwise, it's a class dependency. We will store the class name
            // so that we can create it later.
            else {
                $dependencies[$key]['type'] = 'class';
                $dependencies[$key]['value'] = $dependency->name;
            }
        }

        return $dependencies;
    }
private function resolveParameters($parameters): array
    {
        // this will hold our dependencies information
        $dependencies = [];

        // Then loop through the parameters to see what is in the constructor.
        foreach ($parameters as $key => $parameter) {
            // Extract the class name to a dependency.
            $dependency = $parameter->getClass();

            // If it is null, then it is not a class, so we need to see if we've been
            // given a default value. If so, store the value for now.
            if (is_null($dependency)) {
                if ($parameter->isDefaultValueAvailable()) {
                    $dependencies[$key]['type'] = 'default';
                    $dependencies[$key]['value'] = $parameter->getDefaultValue();
                } else {
                    throw new ContainerException('Non class dependency ('.$parameter->name.') requires default value.');
                }
            }
            // Otherwise, it's a class dependency. We will store the class name
            // so that we can create it later.
            else {
                $dependencies[$key]['type'] = 'class';
                $dependencies[$key]['value'] = $dependency->name;
            }
        }

        return $dependencies;
    }
private function resolveParameters ( $ parameters ) : array { // this will hold our dependencies information $ dependencies = [ ] ; // Then loop through the parameters to see what is in the constructor. foreach ( $ parameters as $ key => $ parameter ) { // Extract the class name to a dependency. $ dependency = $ parameter -> getClass ( ) ; // If it is null, then it is not a class, so we need to see if we've been // given a default value. If so, store the value for now. if ( is_null ( $ dependency ) ) { if ( $ parameter -> isDefaultValueAvailable ( ) ) { $ dependencies [ $ key ] [ 'type' ] = 'default' ; $ dependencies [ $ key ] [ 'value' ] = $ parameter -> getDefaultValue ( ) ; } else { throw new ContainerException ( 'Non class dependency (' . $ parameter -> name . ') requires default value.' ) ; } } // Otherwise, it's a class dependency. We will store the class name // so that we can create it later. else { $ dependencies [ $ key ] [ 'type' ] = 'class' ; $ dependencies [ $ key ] [ 'value' ] = $ dependency -> name ; } } return $ dependencies ; }
Process the constructor parameter list that was obtained from
the ReflectionClass and return the resolved dependencies.

@param  array $parameters
@return array
@throws ContainerException
Process the constructor parameter list that was obtained from the ReflectionClass and return the resolved dependencies .