Total Complexity | 8 |
Total Lines | 90 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class Event |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | private $name; |
||
14 | |||
15 | /** |
||
16 | * @var object |
||
17 | */ |
||
18 | private $context; |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | private $info; |
||
24 | |||
25 | /** |
||
26 | * @var bool |
||
27 | */ |
||
28 | private $cancelled = false; |
||
29 | |||
30 | /** |
||
31 | * Event constructor. |
||
32 | * @param string $name |
||
33 | * @param object|null $context |
||
34 | * @param array|null $info |
||
35 | */ |
||
36 | public function __construct(string $name, object $context = null, array $info = null) |
||
37 | { |
||
38 | $this->name = $name; |
||
39 | $this->context = $context; |
||
40 | $this->info = $info; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @return string |
||
45 | */ |
||
46 | public function getName(): string |
||
47 | { |
||
48 | return $this->name; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @return object|null |
||
53 | */ |
||
54 | public function getContext() |
||
55 | { |
||
56 | return $this->context; |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @return bool |
||
61 | */ |
||
62 | public function hasContext() |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @return array|null |
||
69 | */ |
||
70 | public function getInfo() |
||
73 | } |
||
74 | |||
75 | /** |
||
76 | * @return bool |
||
77 | */ |
||
78 | public function hasInfo() |
||
81 | } |
||
82 | |||
83 | /** |
||
84 | * @return bool |
||
85 | */ |
||
86 | public function isCancelled(): bool |
||
87 | { |
||
88 | return $this->cancelled; |
||
89 | } |
||
90 | |||
91 | /** |
||
92 | * @return void |
||
93 | */ |
||
94 | public function cancel(): void |
||
97 | } |
||
98 | } |
||
99 |