1 | <?php |
||
20 | abstract class Util |
||
21 | { |
||
22 | /** |
||
23 | * All valid hooks |
||
24 | * |
||
25 | * @var array |
||
26 | */ |
||
27 | private static $validHooks = ['commit-msg' => 1, 'pre-commit' => 1, 'pre-push' => 1]; |
||
28 | |||
29 | /** |
||
30 | * Checks if a hook name is valid. |
||
31 | * |
||
32 | * @param string $hook |
||
33 | * @return bool |
||
34 | */ |
||
35 | 26 | public static function isValid(string $hook) : bool |
|
39 | |||
40 | /** |
||
41 | * Return valid hooks. |
||
42 | * |
||
43 | * @return array |
||
44 | */ |
||
45 | 2 | public static function getValidHooks() : array |
|
49 | |||
50 | /** |
||
51 | * Get a list of all hooks. |
||
52 | * |
||
53 | * @return array |
||
54 | */ |
||
55 | 4 | public static function getHooks() : array |
|
59 | |||
60 | /** |
||
61 | * Return action type. |
||
62 | * |
||
63 | * @param string $action |
||
64 | * @return string |
||
65 | */ |
||
66 | 11 | public static function getActionType(string $action) : string |
|
70 | } |
||
71 |