1 | <?php |
||
26 | class Regex implements Action |
||
27 | { |
||
28 | /** |
||
29 | * Execute the configured action. |
||
30 | * |
||
31 | * @param \SebastianFeldmann\CaptainHook\Config $config |
||
32 | * @param \SebastianFeldmann\CaptainHook\Console\IO $io |
||
33 | * @param \SebastianFeldmann\Git\Repository $repository |
||
34 | * @param \SebastianFeldmann\CaptainHook\Config\Action $action |
||
35 | * @throws \Exception |
||
36 | */ |
||
37 | 4 | public function execute(Config $config, IO $io, Repository $repository, Config\Action $action) |
|
50 | |||
51 | /** |
||
52 | * Extract regex from options array. |
||
53 | * |
||
54 | * @param \SebastianFeldmann\CaptainHook\Config\Options $options |
||
55 | * @return string |
||
56 | * @throws \SebastianFeldmann\CaptainHook\Exception\ActionFailed |
||
57 | */ |
||
58 | 4 | protected function getRegex(Config\Options $options) |
|
66 | |||
67 | /** |
||
68 | * Determine the error message to use. |
||
69 | * |
||
70 | * @param \SebastianFeldmann\CaptainHook\Config\Options $options |
||
71 | * @return string |
||
72 | */ |
||
73 | 3 | protected function getErrorMessage(Config\Options $options) |
|
77 | |||
78 | /** |
||
79 | * Determine the error message to use. |
||
80 | * |
||
81 | * @param \SebastianFeldmann\CaptainHook\Config\Options $options |
||
82 | * @return string |
||
83 | */ |
||
84 | 3 | protected function getSuccessMessage(Config\Options $options) |
|
88 | } |
||
89 |