Completed
Pull Request — master (#58)
by
unknown
03:09
created

ProfileEvent::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of TwigView.
4
 *
5
 ** (c) 2015 Cees-Jan Kiewiet
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace WyriHaximus\TwigView\Event;
12
13
use Cake\Event\Event;
14
use Twig\Profiler\Profile;
15
16
class ProfileEvent extends Event
17
{
18
    const EVENT = 'TwigView.TwigView.profile';
19
20
    /**
21
     * @param  \Twig\Profiler\Profile $profile
22
     * @return static
23
     */
24 1
    public static function create(Profile $profile)
25
    {
26 1
        return new static(static::EVENT, $profile);
27
    }
28
29
    /**
30
     * @return \Twig\Profiler\Profile
31
     */
32
    public function getLoader()
33
    {
34
        return $this->subject();
0 ignored issues
show
Deprecated Code introduced by
The method Cake\Event\Event::subject() has been deprecated with message: 3.4.0 use getSubject() instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
35
    }
36
}
37