1 | <?php |
||
26 | class Regex implements Action |
||
27 | { |
||
28 | const MESSAGE_ERROR = 'error'; |
||
29 | const MESSAGE_SUCCESS = 'success'; |
||
30 | |||
31 | /** |
||
32 | * Execute the configured action. |
||
33 | * |
||
34 | * @param \SebastianFeldmann\CaptainHook\Config $config |
||
35 | * @param \SebastianFeldmann\CaptainHook\Console\IO $io |
||
36 | * @param \SebastianFeldmann\Git\Repository $repository |
||
37 | * @param \SebastianFeldmann\CaptainHook\Config\Action $action |
||
38 | * @throws \Exception |
||
39 | */ |
||
40 | 3 | public function execute(Config $config, IO $io, Repository $repository, Config\Action $action) |
|
55 | |||
56 | /** |
||
57 | * Extract regex from options array. |
||
58 | * |
||
59 | * @param \SebastianFeldmann\CaptainHook\Config\Options $options |
||
60 | * @return string |
||
61 | * @throws \SebastianFeldmann\CaptainHook\Exception\ActionFailed |
||
62 | */ |
||
63 | 3 | protected function getRegex(Config\Options $options) |
|
71 | |||
72 | /** |
||
73 | * Extract success/error message from options array. |
||
74 | * |
||
75 | * @param Config\Options $options |
||
76 | * @param string $type |
||
77 | * @return string|null |
||
78 | */ |
||
79 | 2 | protected function getMessage(Config\Options $options, string $type) |
|
87 | } |
||
88 |