function TestMiddleware::__construct

Same name in other branches
  1. 9 core/modules/system/tests/modules/httpkernel_test/src/HttpKernel/TestMiddleware.php \Drupal\httpkernel_test\HttpKernel\TestMiddleware::__construct()
  2. 8.9.x core/modules/system/tests/modules/httpkernel_test/src/HttpKernel/TestMiddleware.php \Drupal\httpkernel_test\HttpKernel\TestMiddleware::__construct()
  3. 10 core/modules/system/tests/modules/http_kernel_test/src/HttpKernel/TestMiddleware.php \Drupal\http_kernel_test\HttpKernel\TestMiddleware::__construct()

Constructs a new TestMiddleware object.

Parameters

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

mixed $optional_argument: (optional) An optional argument.

File

core/modules/system/tests/modules/http_kernel_test/src/HttpKernel/TestMiddleware.php, line 38

Class

TestMiddleware
Provides a test middleware.

Namespace

Drupal\http_kernel_test\HttpKernel

Code

public function __construct(HttpKernelInterface $kernel, $optional_argument = NULL) {
    $this->kernel = $kernel;
    $this->optionalArgument = $optional_argument;
}

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