Passed
Branch latest (76d169)
by Colin
01:59
created

ListenerData   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getListener() 0 3 1
A getEvent() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the league/commonmark package.
7
 *
8
 * (c) Colin O'Dell <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace League\CommonMark\Event;
15
16
/**
17
 * @internal
18
 *
19
 * @psalm-immutable
20
 */
21
final class ListenerData
22
{
23
    /** @var string */
24
    private $event;
25
26
    /** @var callable */
27
    private $listener;
28
29 606
    public function __construct(string $event, callable $listener)
30
    {
31 606
        $this->event    = $event;
32 606
        $this->listener = $listener;
33 606
    }
34
35 600
    public function getEvent(): string
36
    {
37 600
        return $this->event;
38
    }
39
40 600
    public function getListener(): callable
41
    {
42 600
        return $this->listener;
43
    }
44
}
45