function StackedHttpKernel::terminate

Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php \Drupal\Core\StackMiddleware\StackedHttpKernel::terminate()

File

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

Class

StackedHttpKernel
Provides a stacked HTTP kernel.

Namespace

Drupal\Core\StackMiddleware

Code

public function terminate(Request $request, Response $response) : void {
    $previous = NULL;
    foreach ($this->middlewares as $kernel) {
        // If the previous kernel was terminable we can assume this middleware
        // has already been called.
        if (!$previous instanceof TerminableInterface && $kernel instanceof TerminableInterface) {
            $kernel->terminate($request, $response);
        }
        $previous = $kernel;
    }
}

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