1 | <?php |
||
26 | class Configurator extends Runner |
||
27 | { |
||
28 | /** |
||
29 | * Force mode |
||
30 | * |
||
31 | * @var bool |
||
32 | */ |
||
33 | private $force; |
||
34 | |||
35 | /** |
||
36 | * Extend existing config or create new one |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | private $mode; |
||
41 | |||
42 | /** |
||
43 | * Use express setup mode |
||
44 | * |
||
45 | * @var bool |
||
46 | */ |
||
47 | private $advanced; |
||
48 | |||
49 | /** |
||
50 | * Execute the configurator |
||
51 | */ |
||
52 | 4 | public function run() |
|
67 | |||
68 | /** |
||
69 | * Force mode setter |
||
70 | * |
||
71 | * @param bool $force |
||
72 | * @return \SebastianFeldmann\CaptainHook\Runner\Configurator |
||
73 | */ |
||
74 | 2 | public function force(bool $force) : Configurator |
|
79 | |||
80 | /** |
||
81 | * Set configuration mode |
||
82 | * |
||
83 | * @param bool $extend |
||
84 | * @return \SebastianFeldmann\CaptainHook\Runner\Configurator |
||
85 | */ |
||
86 | 3 | public function extend(bool $extend) : Configurator |
|
91 | |||
92 | /** |
||
93 | * Set configuration speed |
||
94 | * |
||
95 | * @param bool $advanced |
||
96 | * @return \SebastianFeldmann\CaptainHook\Runner\Configurator |
||
97 | */ |
||
98 | 4 | public function advanced(bool $advanced) : Configurator |
|
103 | |||
104 | /** |
||
105 | * Return config to handle |
||
106 | * |
||
107 | * @return \SebastianFeldmann\CaptainHook\Config |
||
108 | */ |
||
109 | 4 | public function getConfigToManipulate() : Config |
|
119 | |||
120 | /** |
||
121 | * Return the setup handler to ask the user questions |
||
122 | * |
||
123 | * @return \SebastianFeldmann\CaptainHook\Runner\Configurator\Setup |
||
124 | */ |
||
125 | 3 | private function getHookSetup() |
|
131 | |||
132 | /** |
||
133 | * Make sure force mode is set if config file exists |
||
134 | * |
||
135 | * @throws \RuntimeException |
||
136 | */ |
||
137 | 2 | private function ensureForce() |
|
143 | |||
144 | /** |
||
145 | * Write config to project root |
||
146 | * |
||
147 | * @param \SebastianFeldmann\CaptainHook\Config $config |
||
148 | */ |
||
149 | 3 | public function writeConfig(Config $config) |
|
155 | } |
||
156 |