private function resolveMiddleware(array $middleware) : array
    {
        $resolvedMiddleware = [];

        foreach ($middleware as $singleMiddleware) {
            if ($singleMiddleware instanceof MiddlewareParameters) {
                /** @var MiddlewareParameters $singleMiddleware */
                /** @var ParameterizedMiddleware $tempMiddleware */
                $tempMiddleware = $this->dependencyResolver->resolve($singleMiddleware->getMiddlewareClassName());
                $tempMiddleware->setParameters($singleMiddleware->getParameters());
                $singleMiddleware = $tempMiddleware;
            } elseif (is_string($singleMiddleware)) {
                $singleMiddleware = $this->dependencyResolver->resolve($singleMiddleware);
            }

            $resolvedMiddleware[] = $singleMiddleware;
        }

        return $resolvedMiddleware;
    }
private function resolveMiddleware(array $middleware) : array
    {
        $resolvedMiddleware = [];

        foreach ($middleware as $singleMiddleware) {
            if ($singleMiddleware instanceof MiddlewareParameters) {
                /** @var MiddlewareParameters $singleMiddleware */
                /** @var ParameterizedMiddleware $tempMiddleware */
                $tempMiddleware = $this->dependencyResolver->resolve($singleMiddleware->getMiddlewareClassName());
                $tempMiddleware->setParameters($singleMiddleware->getParameters());
                $singleMiddleware = $tempMiddleware;
            } elseif (is_string($singleMiddleware)) {
                $singleMiddleware = $this->dependencyResolver->resolve($singleMiddleware);
            }

            $resolvedMiddleware[] = $singleMiddleware;
        }

        return $resolvedMiddleware;
    }
private function resolveMiddleware ( array $ middleware ) : array { $ resolvedMiddleware = [ ] ; foreach ( $ middleware as $ singleMiddleware ) { if ( $ singleMiddleware instanceof MiddlewareParameters ) { /** @var MiddlewareParameters $singleMiddleware */ /** @var ParameterizedMiddleware $tempMiddleware */ $ tempMiddleware = $ this -> dependencyResolver -> resolve ( $ singleMiddleware -> getMiddlewareClassName ( ) ) ; $ tempMiddleware -> setParameters ( $ singleMiddleware -> getParameters ( ) ) ; $ singleMiddleware = $ tempMiddleware ; } elseif ( is_string ( $ singleMiddleware ) ) { $ singleMiddleware = $ this -> dependencyResolver -> resolve ( $ singleMiddleware ) ; } $ resolvedMiddleware [ ] = $ singleMiddleware ; } return $ resolvedMiddleware ; }
Resolves the list of middleware

@param array $middleware The middleware to resolve
@return IMiddleware[] The list of resolved middleware
Resolves the list of middleware