1 | <?php |
||
20 | class Hook |
||
21 | { |
||
22 | /** |
||
23 | * Is hook enabled |
||
24 | * |
||
25 | * @var bool |
||
26 | */ |
||
27 | private $isEnabled = false; |
||
28 | |||
29 | /** |
||
30 | * List of Actions |
||
31 | * |
||
32 | * @var \SebastianFeldmann\CaptainHook\Config\Action[] |
||
33 | */ |
||
34 | private $actions = []; |
||
35 | |||
36 | /** |
||
37 | * Hook constructor. |
||
38 | * |
||
39 | * @param bool $enabled |
||
40 | */ |
||
41 | 39 | public function __construct(bool $enabled = false) |
|
45 | |||
46 | /** |
||
47 | * Enable or disable the hook. |
||
48 | * |
||
49 | * @param bool $enabled |
||
50 | */ |
||
51 | 12 | public function setEnabled(bool $enabled) |
|
55 | |||
56 | /** |
||
57 | * Is this hook enabled. |
||
58 | * |
||
59 | * @return bool |
||
60 | */ |
||
61 | 8 | public function isEnabled() : bool |
|
65 | |||
66 | /** |
||
67 | * Add an action to the list. |
||
68 | * |
||
69 | * @param \SebastianFeldmann\CaptainHook\Config\Action $action |
||
70 | */ |
||
71 | 8 | public function addAction(Action $action) |
|
75 | |||
76 | /** |
||
77 | * Return the action list. |
||
78 | * |
||
79 | * @return \SebastianFeldmann\CaptainHook\Config\Action[] |
||
80 | */ |
||
81 | 8 | public function getActions() : array |
|
85 | |||
86 | /** |
||
87 | * Return config data. |
||
88 | * |
||
89 | * @return array |
||
90 | */ |
||
91 | 7 | public function getJsonData() : array |
|
99 | } |
||
100 |