KernelWrapper::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace PHPFastCGI\SpeedfonyBundle\Bridge;
4
5
use PHPFastCGI\FastCGIDaemon\Http\RequestInterface;
6
use PHPFastCGI\FastCGIDaemon\KernelInterface;
7
use Symfony\Component\HttpKernel\Kernel;
8
9
class KernelWrapper implements KernelInterface
10
{
11
    /**
12
     * @var Kernel 
13
     */
14
    private $kernel;
15
16
    /**
17
     * Constructor.
18
     * 
19
     * @param Kernel $kernel
20
     */
21
    public function __construct(Kernel $kernel)
22
    {
23
        $this->kernel = $kernel;
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function handleRequest(RequestInterface $request)
30
    {
31
        $symfonyRequest = $request->getHttpFoundationRequest();
32
33
        $symfonyResponse = $this->kernel->handle($symfonyRequest);
34
        $this->kernel->terminate($symfonyRequest, $symfonyResponse);
35
36
        return $symfonyResponse;
37
    }
38
}
39