Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
78 / 78 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
EventNames | |
100.00% |
78 / 78 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
getEventNames | |
100.00% |
77 / 77 |
|
100.00% |
1 / 1 |
1 | |||
isEvent | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace pvc\html\event; |
4 | |
5 | class EventNames |
6 | { |
7 | /** |
8 | * @return array<string> |
9 | */ |
10 | public static function getEventNames(): array |
11 | { |
12 | return [ |
13 | 'onabort', |
14 | 'onauxclick', |
15 | 'onbeforeinput', |
16 | 'onbeforematch', |
17 | 'onbeforetoggle', |
18 | 'onblur', |
19 | 'oncancel', |
20 | 'oncanplay', |
21 | 'oncanplaythrough', |
22 | 'onchange', |
23 | 'onclick', |
24 | 'onclose', |
25 | 'oncontextlost', |
26 | 'oncontextmenu', |
27 | 'oncontextrestored', |
28 | 'oncopy', |
29 | 'oncuechange', |
30 | 'oncut', |
31 | 'ondblclick', |
32 | 'ondrag', |
33 | 'ondragend', |
34 | 'ondragenter', |
35 | 'ondragleave', |
36 | 'ondragover', |
37 | 'ondragstart', |
38 | 'ondrop', |
39 | 'ondurationchange', |
40 | 'onemptied', |
41 | 'onended', |
42 | 'onerror', |
43 | 'onfocus', |
44 | 'onformdata', |
45 | 'oninput', |
46 | 'oninvalid', |
47 | 'onkeydown', |
48 | 'onkeypress', |
49 | 'onkeyup', |
50 | 'onload', |
51 | 'onloadeddata', |
52 | 'onloadedmetadata', |
53 | 'onloadstart', |
54 | 'onmousedown', |
55 | 'onmouseenter', |
56 | 'onmouseleave', |
57 | 'onmousemove', |
58 | 'onmouseout', |
59 | 'onmouseover', |
60 | 'onmouseup', |
61 | 'onpaste', |
62 | 'onpause', |
63 | 'onplay', |
64 | 'onplaying', |
65 | 'onprogress', |
66 | 'onratechange', |
67 | 'onreset', |
68 | 'onresize', |
69 | 'onscroll', |
70 | 'onscrollend', |
71 | 'onsecuritypolicyviolation', |
72 | 'onseeked', |
73 | 'onseeking', |
74 | 'onselect', |
75 | 'onslotchange', |
76 | 'onstalled', |
77 | 'onsubmit', |
78 | 'onsuspend', |
79 | 'ontimeupdate', |
80 | 'ontoggle', |
81 | 'onvolumechange', |
82 | 'onwaiting', |
83 | 'onwebkitanimationend', |
84 | 'onwebkitanimationiteration', |
85 | 'onwebkitanimationstart', |
86 | 'onwebkittransitionend', |
87 | 'onwheel', |
88 | ]; |
89 | |
90 | } |
91 | |
92 | public static function isEvent(string $eventName): bool |
93 | { |
94 | return in_array($eventName, self::getEventNames()); |
95 | } |
96 | } |