public function getMiddleware(array $names)
    {
        $out = [];
        foreach ($names as $name) {
            if ($this->hasMiddlewareGroup($name)) {
                $out = array_merge($out, $this->getMiddleware($this->_middlewareGroups[$name]));
                continue;
            }
            if (!$this->hasMiddleware($name)) {
                $message = "The middleware named '$name' has not been registered. Use registerMiddleware() to define it.";
                throw new RuntimeException($message);
            }
            $out[] = $this->_middleware[$name];
        }

        return $out;
    }
public function getMiddleware(array $names)
    {
        $out = [];
        foreach ($names as $name) {
            if ($this->hasMiddlewareGroup($name)) {
                $out = array_merge($out, $this->getMiddleware($this->_middlewareGroups[$name]));
                continue;
            }
            if (!$this->hasMiddleware($name)) {
                $message = "The middleware named '$name' has not been registered. Use registerMiddleware() to define it.";
                throw new RuntimeException($message);
            }
            $out[] = $this->_middleware[$name];
        }

        return $out;
    }
public function getMiddleware ( array $ names ) { $ out = [ ] ; foreach ( $ names as $ name ) { if ( $ this -> hasMiddlewareGroup ( $ name ) ) { $ out = array_merge ( $ out , $ this -> getMiddleware ( $ this -> _middlewareGroups [ $ name ] ) ) ; continue ; } if ( ! $ this -> hasMiddleware ( $ name ) ) { $ message = "The middleware named '$name' has not been registered. Use registerMiddleware() to define it." ; throw new RuntimeException ( $ message ) ; } $ out [ ] = $ this -> _middleware [ $ name ] ; } return $ out ; }
Get an array of middleware given a list of names

@param array $names The names of the middleware or groups to fetch
@return array An array of middleware. If any of the passed names are groups,
the groups middleware will be flattened into the returned list.
@throws \RuntimeException when a requested middleware does not exist.
Get an array of middleware given a list of names