function StackedHttpKernel::__construct

Constructs a stacked HTTP kernel.

Parameters

\Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel: The decorated kernel.

iterable<\Symfony\Component\HttpKernel\HttpKernelInterface> $middlewares: An array of previous middleware services.

File

core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php, line 42

Class

StackedHttpKernel
Provides a stacked HTTP kernel.

Namespace

Drupal\Core\StackMiddleware

Code

public function __construct(HttpKernelInterface $http_kernel, iterable $middlewares) {
  if (is_array($middlewares)) {
    @trigger_error('Calling ' . __METHOD__ . '() with an array of $middlewares is deprecated in drupal:11.3.0 and it will throw an error in drupal:12.0.0. Pass in a lazy iterator instead. See https://www.drupal.org/node/3538740', E_USER_DEPRECATED);
  }
  $this->httpKernel = $http_kernel;
  $this->middlewares = $middlewares;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.