This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Runtime/Tests/phpt/kernel.php

27 lines
589 B
PHP

<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
require __DIR__.'/autoload.php';
class TestKernel implements HttpKernelInterface
{
private $var;
public function __construct(string $var)
{
$this->var = $var;
}
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true)
{
return new Response('OK Kernel '.$this->var);
}
}
return function (array $context) {
return new TestKernel($context['SOME_VAR']);
};