@@ -12,8 +12,7 @@ |
||
12 | 12 | * @param array $auth |
13 | 13 | * @return self |
14 | 14 | */ |
15 | - public function setAuthObject(array $auth) |
|
16 | - { |
|
15 | + public function setAuthObject(array $auth) { |
|
17 | 16 | $this->message = sprintf(static::TPL, json_encode($auth, JSON_PRETTY_PRINT)); |
18 | 17 | return $this; |
19 | 18 | } |
@@ -21,8 +21,7 @@ discard block |
||
21 | 21 | * Config constructor. |
22 | 22 | * @param OutputInterface $output |
23 | 23 | */ |
24 | - public function __construct(OutputInterface $output) |
|
25 | - { |
|
24 | + public function __construct(OutputInterface $output) { |
|
26 | 25 | $this->_projectPath = getcwd(); |
27 | 26 | $this->output = $output; |
28 | 27 | } |
@@ -31,8 +30,7 @@ discard block |
||
31 | 30 | * @param $name |
32 | 31 | * @return mixed |
33 | 32 | */ |
34 | - function __get($name) |
|
35 | - { |
|
33 | + function __get($name) { |
|
36 | 34 | $this->_config = $this->getConfigFile($this->output); |
37 | 35 | return $this->_config['magestead']['apps']['mba_12345'][$name]; |
38 | 36 | } |
@@ -41,8 +39,7 @@ discard block |
||
41 | 39 | * @param OutputInterface $output |
42 | 40 | * @return bool|mixed |
43 | 41 | */ |
44 | - protected function getConfigFile(OutputInterface $output) |
|
45 | - { |
|
42 | + protected function getConfigFile(OutputInterface $output) { |
|
46 | 43 | $config = new Parser(); |
47 | 44 | try { |
48 | 45 | return $config->parse($this->readConfigFile()); |
@@ -57,8 +54,7 @@ discard block |
||
57 | 54 | * @return string |
58 | 55 | * @throws MissingConfigFileException |
59 | 56 | */ |
60 | - protected function readConfigFile() |
|
61 | - { |
|
57 | + protected function readConfigFile() { |
|
62 | 58 | if (!file_exists($this->_projectPath . '/magestead.yaml')) { |
63 | 59 | throw new MissingConfigFileException('No config file was found, are you in the project root?'); |
64 | 60 | } |
@@ -72,8 +68,7 @@ discard block |
||
72 | 68 | * @return string |
73 | 69 | * @throws MissingComposerHomeException |
74 | 70 | */ |
75 | - public function getComposerHomeDir() |
|
76 | - { |
|
71 | + public function getComposerHomeDir() { |
|
77 | 72 | $composerConfig = shell_exec('composer config --list --global | grep "\[home\]"'); |
78 | 73 | $composerConfig = array_filter(explode(PHP_EOL, $composerConfig)); |
79 | 74 |
@@ -38,8 +38,7 @@ discard block |
||
38 | 38 | * @param OutputInterface $output |
39 | 39 | * @param $project |
40 | 40 | */ |
41 | - public function __construct($helper, InputInterface $input, OutputInterface $output, $project) |
|
42 | - { |
|
41 | + public function __construct($helper, InputInterface $input, OutputInterface $output, $project) { |
|
43 | 42 | $this->setVagrantSettings($helper, $input, $output); |
44 | 43 | |
45 | 44 | $this->setServerConfig($helper, $input, $output); |
@@ -54,8 +53,7 @@ discard block |
||
54 | 53 | /** |
55 | 54 | * @return array |
56 | 55 | */ |
57 | - public function getAllOptions() |
|
58 | - { |
|
56 | + public function getAllOptions() { |
|
59 | 57 | return [ |
60 | 58 | 'app' => $this->_app, |
61 | 59 | 'server' => $this->_server, |
@@ -80,8 +78,7 @@ discard block |
||
80 | 78 | * @param InputInterface $input |
81 | 79 | * @param OutputInterface $output |
82 | 80 | */ |
83 | - protected function setVagrantSettings($helper, InputInterface $input, OutputInterface $output) |
|
84 | - { |
|
81 | + protected function setVagrantSettings($helper, InputInterface $input, OutputInterface $output) { |
|
85 | 82 | $output->writeln('<comment>Lets configure your project\'s VM</comment>'); |
86 | 83 | |
87 | 84 | $ipQuestion = new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47'); |
@@ -100,8 +97,7 @@ discard block |
||
100 | 97 | * @param OutputInterface $output |
101 | 98 | * @param $project |
102 | 99 | */ |
103 | - protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output, $project) |
|
104 | - { |
|
100 | + protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output, $project) { |
|
105 | 101 | $output->writeln('<comment>Lets configure your project\'s application</comment>'); |
106 | 102 | $appQuestion = new ChoiceQuestion( |
107 | 103 | "Which application do you want to install?", |
@@ -127,8 +123,7 @@ discard block |
||
127 | 123 | * @param OutputInterface $output |
128 | 124 | * @return boolean|integer |
129 | 125 | */ |
130 | - protected function setMagento2Settings($helper, InputInterface $input, OutputInterface $output) |
|
131 | - { |
|
126 | + protected function setMagento2Settings($helper, InputInterface $input, OutputInterface $output) { |
|
132 | 127 | if ($this->_app === 'magento2') { |
133 | 128 | $this->installSampleData($helper, $input, $output); |
134 | 129 | return $this->verifyAuth($helper, $input, $output); |
@@ -142,8 +137,7 @@ discard block |
||
142 | 137 | * @param InputInterface $input |
143 | 138 | * @param OutputInterface $output |
144 | 139 | */ |
145 | - protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) |
|
146 | - { |
|
140 | + protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) { |
|
147 | 141 | $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
148 | 142 | $versioning = $helper->ask($input, $output, $versionControl); |
149 | 143 | if ($versioning) { |
@@ -152,8 +146,7 @@ discard block |
||
152 | 146 | } |
153 | 147 | } |
154 | 148 | |
155 | - protected function installSampleData($helper, InputInterface $input, OutputInterface $output) |
|
156 | - { |
|
149 | + protected function installSampleData($helper, InputInterface $input, OutputInterface $output) { |
|
157 | 150 | $sampleInstall = new ConfirmationQuestion("Would you like to install sample data? (no/yes) ", false); |
158 | 151 | $this->installSampleData = $helper->ask($input, $output, $sampleInstall); |
159 | 152 | } |
@@ -163,8 +156,7 @@ discard block |
||
163 | 156 | * @param InputInterface $input |
164 | 157 | * @param OutputInterface $output |
165 | 158 | */ |
166 | - protected function askForAuth($helper, InputInterface $input, OutputInterface $output) |
|
167 | - { |
|
159 | + protected function askForAuth($helper, InputInterface $input, OutputInterface $output) { |
|
168 | 160 | $username = new Question("Please enter your Magento username (public key): ", ''); |
169 | 161 | $this->_m2Username = $helper->ask($input, $output, $username); |
170 | 162 | |
@@ -178,8 +170,7 @@ discard block |
||
178 | 170 | * @param OutputInterface $output |
179 | 171 | * @return boolean|integer |
180 | 172 | */ |
181 | - protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) |
|
182 | - { |
|
173 | + protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) { |
|
183 | 174 | $composerHome = (new Config($output))->getComposerHomeDir(); |
184 | 175 | $authFile = $composerHome . "/auth.json"; |
185 | 176 | |
@@ -214,8 +205,7 @@ discard block |
||
214 | 205 | * @param InputInterface $input |
215 | 206 | * @param OutputInterface $output |
216 | 207 | */ |
217 | - protected function setPhp($helper, InputInterface $input, OutputInterface $output) |
|
218 | - { |
|
208 | + protected function setPhp($helper, InputInterface $input, OutputInterface $output) { |
|
219 | 209 | $phpVerQuestion = new ChoiceQuestion( |
220 | 210 | "Which version of PHP should be installed?", |
221 | 211 | ['56', '70'], |
@@ -228,8 +218,7 @@ discard block |
||
228 | 218 | /** |
229 | 219 | * Set box name from concat user options |
230 | 220 | */ |
231 | - protected function setVagrantBox() |
|
232 | - { |
|
221 | + protected function setVagrantBox() { |
|
233 | 222 | $this->_box = self::BOX_PREFIX . $this->_os . "-$this->_server-php$this->_phpVer"; |
234 | 223 | } |
235 | 224 | |
@@ -238,8 +227,7 @@ discard block |
||
238 | 227 | * @param InputInterface $input |
239 | 228 | * @param OutputInterface $output |
240 | 229 | */ |
241 | - protected function setServerConfig($helper, InputInterface $input, OutputInterface $output) |
|
242 | - { |
|
230 | + protected function setServerConfig($helper, InputInterface $input, OutputInterface $output) { |
|
243 | 231 | $output->writeln('<comment>Lets configure your server</comment>'); |
244 | 232 | $this->setOperatingSystem($helper, $input, $output); |
245 | 233 | $this->setWebServer($helper, $input, $output); |
@@ -251,8 +239,7 @@ discard block |
||
251 | 239 | * @param InputInterface $input |
252 | 240 | * @param OutputInterface $output |
253 | 241 | */ |
254 | - protected function setWebServer($helper, InputInterface $input, OutputInterface $output) |
|
255 | - { |
|
242 | + protected function setWebServer($helper, InputInterface $input, OutputInterface $output) { |
|
256 | 243 | $serverQuestion = new ChoiceQuestion( |
257 | 244 | "Which webserver would you like?", |
258 | 245 | ['NGINX', 'Apache'], |
@@ -267,8 +254,7 @@ discard block |
||
267 | 254 | * @param InputInterface $input |
268 | 255 | * @param OutputInterface $output |
269 | 256 | */ |
270 | - protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) |
|
271 | - { |
|
257 | + protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) { |
|
272 | 258 | $osQuestion = new ChoiceQuestion( |
273 | 259 | "Which OS would you like to install?", |
274 | 260 | ['CentOS 6.5', 'Ubuntu 14'], |