KernelEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
nc 1
nop 2
dl 0
loc 2
ccs 0
cts 1
cp 0
crap 2
rs 10
c 1
b 0
f 0
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