KernelEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 31
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getKernel() 0 4 1
A getRequest() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the jade/jade package.
5
 *
6
 * (c) Slince <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Jade\HttpKernel\Event;
13
14
use Psr\Http\Message\ServerRequestInterface;
15
use Jade\HttpKernel\HttpKernel;
16
use Symfony\Contracts\EventDispatcher\Event;
17
18
class KernelEvent extends Event
19
{
20
    protected $kernel;
21
    protected $request;
22
23
    public function __construct(HttpKernel $kernel, ServerRequestInterface $request)
24
    {
25
        $this->kernel = $kernel;
26
        $this->request = $request;
27
    }
28
29
    /**
30
     * 返回 http kernel
31
     *
32
     * @return HttpKernel
33
     */
34
    public function getKernel()
35
    {
36
        return $this->kernel;
37
    }
38
39
    /**
40
     * 返回当前正在处理中的请求
41
     *
42
     * @return ServerRequestInterface
43
     */
44
    public function getRequest()
45
    {
46
        return $this->request;
47
    }
48
}