KernelEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 20
ccs 0
cts 5
cp 0
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getApplication() 0 3 1
A __construct() 0 2 1
A getRequest() 0 3 1
1
<?php declare(strict_types=1);
2
3
/*
4
 * This file is part of Biurad opensource projects.
5
 *
6
 * @copyright 2019 Biurad Group (https://biurad.com/)
7
 * @license   https://opensource.org/licenses/BSD-3-Clause License
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Flange\Event;
14
15
use Flange\Application;
16
use Psr\Http\Message\ServerRequestInterface as Request;
17
use Symfony\Contracts\EventDispatcher\Event;
18
19
/**
20
 * Base class for events thrown in the Application's class.
21
 *
22
 * @author Divine Niiquaye Ibok <[email protected]>
23
 */
24
class KernelEvent extends Event
25
{
26
    public function __construct(private Application $kernel, private Request $request)
27
    {
28
    }
29
30
    /**
31
     * Returns the kernel in which this event was thrown.
32
     */
33
    public function getApplication(): Application
34
    {
35
        return $this->kernel;
36
    }
37
38
    /**
39
     * Returns the request the kernel is currently processing.
40
     */
41
    public function getRequest(): Request
42
    {
43
        return $this->request;
44
    }
45
}
46