ProfileEvent::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * This file is part of TwigView.
6
 *
7
 ** (c) 2015 Cees-Jan Kiewiet
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 WyriHaximus\TwigView\Event;
14
15
use Cake\Event\Event;
16
use Twig\Profiler\Profile;
17
18
final class ProfileEvent extends Event
19
{
20
    public const EVENT = 'TwigView.TwigView.profile';
21
22
    /**
23
     * @param  \Twig\Profiler\Profile $profile
24
     * @return static
25
     */
26
    public static function create(Profile $profile): ProfileEvent
27
    {
28
        return new static(static::EVENT, $profile);
29
    }
30
31
    /**
32
     * @return \Twig\Profiler\Profile
33
     */
34
    public function getLoader(): Profile
35
    {
36
        return $this->getSubject();
37
    }
38
}
39