@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | /** |
36 | 36 | * @param Config $config |
37 | - * @return bool|string |
|
37 | + * @return string|false |
|
38 | 38 | */ |
39 | 39 | protected function getCommand(Config $config) |
40 | 40 | { |
@@ -15,8 +15,7 @@ discard block |
||
15 | 15 | protected $_config; |
16 | 16 | protected $_projectPath; |
17 | 17 | |
18 | - protected function configure() |
|
19 | - { |
|
18 | + protected function configure() { |
|
20 | 19 | $this->_projectPath = getcwd(); |
21 | 20 | $this->setName("cache:disable"); |
22 | 21 | $this->setDescription("Disable cache types"); |
@@ -27,8 +26,7 @@ discard block |
||
27 | 26 | * @param OutputInterface $output |
28 | 27 | * @return ProcessCommand |
29 | 28 | */ |
30 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
31 | - { |
|
29 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
32 | 30 | $output->writeln('<info>Disabling all cache types</info>'); |
33 | 31 | |
34 | 32 | $command = $this->getCommand(new Config($output)); |
@@ -40,8 +38,7 @@ discard block |
||
40 | 38 | * @param Config $config |
41 | 39 | * @return bool|string |
42 | 40 | */ |
43 | - protected function getCommand(Config $config) |
|
44 | - { |
|
41 | + protected function getCommand(Config $config) { |
|
45 | 42 | $type = $config->type; |
46 | 43 | switch ($type) { |
47 | 44 | case 'magento': |
@@ -52,6 +52,6 @@ |
||
52 | 52 | break; |
53 | 53 | } |
54 | 54 | |
55 | - return false; |
|
55 | + return FALSE; |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | \ No newline at end of file |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | protected function configure() |
19 | 19 | { |
20 | - $this->_projectPath = getcwd(); |
|
20 | + $this->_projectPath=getcwd(); |
|
21 | 21 | $this->setName("cache:status"); |
22 | 22 | $this->setDescription("Checks cache status"); |
23 | 23 | } |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | { |
32 | 32 | $output->writeln('<info>Checking cache status</info>'); |
33 | 33 | |
34 | - $command = $this->getCommand(new Config($output)); |
|
35 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
34 | + $command=$this->getCommand(new Config($output)); |
|
35 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
36 | 36 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
37 | 37 | } |
38 | 38 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | protected function getCommand(Config $config) |
44 | 44 | { |
45 | - $type = $config->type; |
|
45 | + $type=$config->type; |
|
46 | 46 | switch ($type) { |
47 | 47 | case 'magento': |
48 | 48 | return "cd /var/www/public;../bin/n98-magerun.phar cache:list"; |
@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | /** |
36 | 36 | * @param Config $config |
37 | - * @return bool|string |
|
37 | + * @return string|false |
|
38 | 38 | */ |
39 | 39 | protected function getCommand(Config $config) |
40 | 40 | { |
@@ -15,8 +15,7 @@ discard block |
||
15 | 15 | protected $_config; |
16 | 16 | protected $_projectPath; |
17 | 17 | |
18 | - protected function configure() |
|
19 | - { |
|
18 | + protected function configure() { |
|
20 | 19 | $this->_projectPath = getcwd(); |
21 | 20 | $this->setName("cache:disable"); |
22 | 21 | $this->setDescription("Disable cache types"); |
@@ -27,8 +26,7 @@ discard block |
||
27 | 26 | * @param OutputInterface $output |
28 | 27 | * @return ProcessCommand |
29 | 28 | */ |
30 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
31 | - { |
|
29 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
32 | 30 | $output->writeln('<info>Disabling all cache types</info>'); |
33 | 31 | |
34 | 32 | $command = $this->getCommand(new Config($output)); |
@@ -40,8 +38,7 @@ discard block |
||
40 | 38 | * @param Config $config |
41 | 39 | * @return bool|string |
42 | 40 | */ |
43 | - protected function getCommand(Config $config) |
|
44 | - { |
|
41 | + protected function getCommand(Config $config) { |
|
45 | 42 | $type = $config->type; |
46 | 43 | switch ($type) { |
47 | 44 | case 'magento': |
@@ -52,6 +52,6 @@ |
||
52 | 52 | break; |
53 | 53 | } |
54 | 54 | |
55 | - return false; |
|
55 | + return FALSE; |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | \ No newline at end of file |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | protected function configure() |
19 | 19 | { |
20 | - $this->_projectPath = getcwd(); |
|
20 | + $this->_projectPath=getcwd(); |
|
21 | 21 | $this->setName("cache:status"); |
22 | 22 | $this->setDescription("Checks cache status"); |
23 | 23 | } |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | { |
32 | 32 | $output->writeln('<info>Checking cache status</info>'); |
33 | 33 | |
34 | - $command = $this->getCommand(new Config($output)); |
|
35 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
34 | + $command=$this->getCommand(new Config($output)); |
|
35 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
36 | 36 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
37 | 37 | } |
38 | 38 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | protected function getCommand(Config $config) |
44 | 44 | { |
45 | - $type = $config->type; |
|
45 | + $type=$config->type; |
|
46 | 46 | switch ($type) { |
47 | 47 | case 'magento': |
48 | 48 | return "cd /var/www/public;../bin/n98-magerun.phar cache:list"; |
@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | /** |
36 | 36 | * @param Config $config |
37 | - * @return bool|string |
|
37 | + * @return string|false |
|
38 | 38 | */ |
39 | 39 | protected function getCommand(Config $config) |
40 | 40 | { |
@@ -15,8 +15,7 @@ discard block |
||
15 | 15 | protected $_config; |
16 | 16 | protected $_projectPath; |
17 | 17 | |
18 | - protected function configure() |
|
19 | - { |
|
18 | + protected function configure() { |
|
20 | 19 | $this->_projectPath = getcwd(); |
21 | 20 | $this->setName("cache:disable"); |
22 | 21 | $this->setDescription("Disable cache types"); |
@@ -27,8 +26,7 @@ discard block |
||
27 | 26 | * @param OutputInterface $output |
28 | 27 | * @return ProcessCommand |
29 | 28 | */ |
30 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
31 | - { |
|
29 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
32 | 30 | $output->writeln('<info>Disabling all cache types</info>'); |
33 | 31 | |
34 | 32 | $command = $this->getCommand(new Config($output)); |
@@ -40,8 +38,7 @@ discard block |
||
40 | 38 | * @param Config $config |
41 | 39 | * @return bool|string |
42 | 40 | */ |
43 | - protected function getCommand(Config $config) |
|
44 | - { |
|
41 | + protected function getCommand(Config $config) { |
|
45 | 42 | $type = $config->type; |
46 | 43 | switch ($type) { |
47 | 44 | case 'magento': |
@@ -52,6 +52,6 @@ |
||
52 | 52 | break; |
53 | 53 | } |
54 | 54 | |
55 | - return false; |
|
55 | + return FALSE; |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | \ No newline at end of file |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | protected function configure() |
19 | 19 | { |
20 | - $this->_projectPath = getcwd(); |
|
20 | + $this->_projectPath=getcwd(); |
|
21 | 21 | $this->setName("cache:status"); |
22 | 22 | $this->setDescription("Checks cache status"); |
23 | 23 | } |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | { |
32 | 32 | $output->writeln('<info>Checking cache status</info>'); |
33 | 33 | |
34 | - $command = $this->getCommand(new Config($output)); |
|
35 | - $pCommand = "vagrant ssh -c '". $command ."'"; |
|
34 | + $command=$this->getCommand(new Config($output)); |
|
35 | + $pCommand="vagrant ssh -c '".$command."'"; |
|
36 | 36 | return new ProcessCommand($pCommand, $this->_projectPath, $output); |
37 | 37 | } |
38 | 38 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | protected function getCommand(Config $config) |
44 | 44 | { |
45 | - $type = $config->type; |
|
45 | + $type=$config->type; |
|
46 | 46 | switch ($type) { |
47 | 47 | case 'magento': |
48 | 48 | return "cd /var/www/public;../bin/n98-magerun.phar cache:list"; |
@@ -9,8 +9,8 @@ |
||
9 | 9 | /** |
10 | 10 | * @param array $options |
11 | 11 | * @param array $config |
12 | - * @param $projectPath |
|
13 | - * @param $output |
|
12 | + * @param string $projectPath |
|
13 | + * @param \Symfony\Component\Console\Output\OutputInterface $output |
|
14 | 14 | * @return Magento2Project|MagentoProject |
15 | 15 | */ |
16 | 16 | public static function create(array $options, array $config, $projectPath, $output) |
@@ -13,8 +13,7 @@ |
||
13 | 13 | * @param $output |
14 | 14 | * @return Magento2Project|MagentoProject |
15 | 15 | */ |
16 | - public static function create(array $options, array $config, $projectPath, $output) |
|
17 | - { |
|
16 | + public static function create(array $options, array $config, $projectPath, $output) { |
|
18 | 17 | switch ($options['app']) { |
19 | 18 | case "magento": |
20 | 19 | return new MagentoProject($options, $config, $projectPath, $output); |
@@ -15,8 +15,7 @@ discard block |
||
15 | 15 | * @param $projectPath |
16 | 16 | * @param OutputInterface $output |
17 | 17 | */ |
18 | - public function __construct($repoUrl, $projectPath, OutputInterface $output) |
|
19 | - { |
|
18 | + public function __construct($repoUrl, $projectPath, OutputInterface $output) { |
|
20 | 19 | $this->_repoUrl = $repoUrl; |
21 | 20 | $this->_projectPath = $projectPath; |
22 | 21 | $this->_output = $output; |
@@ -27,8 +26,7 @@ discard block |
||
27 | 26 | /** |
28 | 27 | * @param OutputInterface $output |
29 | 28 | */ |
30 | - protected function execute(OutputInterface $output) |
|
31 | - { |
|
29 | + protected function execute(OutputInterface $output) { |
|
32 | 30 | $output->writeln('<info>Configuring GIT repo</info>'); |
33 | 31 | $this->init(); |
34 | 32 | |
@@ -47,8 +45,7 @@ discard block |
||
47 | 45 | * |
48 | 46 | * @return $this |
49 | 47 | */ |
50 | - public function init() |
|
51 | - { |
|
48 | + public function init() { |
|
52 | 49 | $command = 'git init; git remote add origin ' . $this->_repoUrl; |
53 | 50 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
54 | 51 | |
@@ -60,8 +57,7 @@ discard block |
||
60 | 57 | * |
61 | 58 | * @return $this |
62 | 59 | */ |
63 | - public function addFiles() |
|
64 | - { |
|
60 | + public function addFiles() { |
|
65 | 61 | $command = 'git add -A'; |
66 | 62 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
67 | 63 | |
@@ -73,8 +69,7 @@ discard block |
||
73 | 69 | * |
74 | 70 | * @return $this |
75 | 71 | */ |
76 | - public function commitFiles() |
|
77 | - { |
|
72 | + public function commitFiles() { |
|
78 | 73 | $command = "git commit -m 'Initial commit'"; |
79 | 74 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
80 | 75 | |
@@ -86,8 +81,7 @@ discard block |
||
86 | 81 | * |
87 | 82 | * @return $this |
88 | 83 | */ |
89 | - public function pushFiles() |
|
90 | - { |
|
84 | + public function pushFiles() { |
|
91 | 85 | $command = "git push -u origin master"; |
92 | 86 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
93 | 87 |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | */ |
18 | 18 | public function __construct($repoUrl, $projectPath, OutputInterface $output) |
19 | 19 | { |
20 | - $this->_repoUrl = $repoUrl; |
|
21 | - $this->_projectPath = $projectPath; |
|
22 | - $this->_output = $output; |
|
20 | + $this->_repoUrl=$repoUrl; |
|
21 | + $this->_projectPath=$projectPath; |
|
22 | + $this->_output=$output; |
|
23 | 23 | |
24 | 24 | $this->execute($output); |
25 | 25 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function init() |
51 | 51 | { |
52 | - $command = 'git init; git remote add origin ' . $this->_repoUrl; |
|
52 | + $command='git init; git remote add origin '.$this->_repoUrl; |
|
53 | 53 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
54 | 54 | |
55 | 55 | return $this; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function addFiles() |
64 | 64 | { |
65 | - $command = 'git add -A'; |
|
65 | + $command='git add -A'; |
|
66 | 66 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
67 | 67 | |
68 | 68 | return $this; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function commitFiles() |
77 | 77 | { |
78 | - $command = "git commit -m 'Initial commit'"; |
|
78 | + $command="git commit -m 'Initial commit'"; |
|
79 | 79 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
80 | 80 | |
81 | 81 | return $this; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function pushFiles() |
90 | 90 | { |
91 | - $command = "git push -u origin master"; |
|
91 | + $command="git push -u origin master"; |
|
92 | 92 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
93 | 93 | |
94 | 94 | return $this; |
@@ -14,8 +14,7 @@ |
||
14 | 14 | * |
15 | 15 | * @param $message |
16 | 16 | */ |
17 | - public static function send($message) |
|
18 | - { |
|
17 | + public static function send($message) { |
|
19 | 18 | $notifier = NotifierFactory::create(); |
20 | 19 | $basePath = dirname( __FILE__ ) . '/../../../'; |
21 | 20 | $notification = |
@@ -16,13 +16,13 @@ |
||
16 | 16 | */ |
17 | 17 | public static function send($message) |
18 | 18 | { |
19 | - $notifier = NotifierFactory::create(); |
|
20 | - $basePath = dirname( __FILE__ ) . '/../../../'; |
|
21 | - $notification = |
|
19 | + $notifier=NotifierFactory::create(); |
|
20 | + $basePath=dirname(__FILE__).'/../../../'; |
|
21 | + $notification= |
|
22 | 22 | (new Notify()) |
23 | 23 | ->setTitle('Magestead') |
24 | 24 | ->setBody($message) |
25 | - ->setIcon($basePath .'assets/magentologo.png') |
|
25 | + ->setIcon($basePath.'assets/magentologo.png') |
|
26 | 26 | ; |
27 | 27 | |
28 | 28 | $notifier->send($notification); |
@@ -12,8 +12,7 @@ discard block |
||
12 | 12 | * @param array $options |
13 | 13 | * @param OutputInterface $output |
14 | 14 | */ |
15 | - public static function verify(array $options, OutputInterface $output) |
|
16 | - { |
|
15 | + public static function verify(array $options, OutputInterface $output) { |
|
17 | 16 | $hostPlugin = `vagrant plugin list | grep vagrant-hostsupdater`; |
18 | 17 | if (is_null($hostPlugin)) { |
19 | 18 | self::editHostsInstructions($options, $output); |
@@ -26,8 +25,7 @@ discard block |
||
26 | 25 | * @param array $options |
27 | 26 | * @param OutputInterface $output |
28 | 27 | */ |
29 | - protected static function editHostsInstructions(array $options, OutputInterface $output) |
|
30 | - { |
|
28 | + protected static function editHostsInstructions(array $options, OutputInterface $output) { |
|
31 | 29 | $output->writeln('<comment>NOTE: You will need to add the following to your hosts file!</comment>'); |
32 | 30 | $comment = $options['vagrantfile']['vm']['network']['private_network'] . |
33 | 31 | ' ' . $options['magestead']['apps']['mba_12345']['base_url']; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | */ |
15 | 15 | public static function verify(array $options, OutputInterface $output) |
16 | 16 | { |
17 | - $hostPlugin = `vagrant plugin list | grep vagrant-hostsupdater`; |
|
17 | + $hostPlugin=`vagrant plugin list | grep vagrant-hostsupdater`; |
|
18 | 18 | if (is_null($hostPlugin)) { |
19 | 19 | self::editHostsInstructions($options, $output); |
20 | 20 | |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | protected static function editHostsInstructions(array $options, OutputInterface $output) |
30 | 30 | { |
31 | 31 | $output->writeln('<comment>NOTE: You will need to add the following to your hosts file!</comment>'); |
32 | - $comment = $options['vagrantfile']['vm']['network']['private_network'] . |
|
33 | - ' ' . $options['magestead']['apps']['mba_12345']['base_url']; |
|
34 | - $output->writeln('<info>' . $comment . '</info>'); |
|
32 | + $comment=$options['vagrantfile']['vm']['network']['private_network']. |
|
33 | + ' '.$options['magestead']['apps']['mba_12345']['base_url']; |
|
34 | + $output->writeln('<info>'.$comment.'</info>'); |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 | \ No newline at end of file |
@@ -13,8 +13,7 @@ discard block |
||
13 | 13 | * Config constructor. |
14 | 14 | * @param OutputInterface $output |
15 | 15 | */ |
16 | - public function __construct(OutputInterface $output) |
|
17 | - { |
|
16 | + public function __construct(OutputInterface $output) { |
|
18 | 17 | $this->_projectPath = getcwd(); |
19 | 18 | $this->_config = $this->getConfigFile($output); |
20 | 19 | } |
@@ -23,8 +22,7 @@ discard block |
||
23 | 22 | * @param $name |
24 | 23 | * @return mixed |
25 | 24 | */ |
26 | - function __get($name) |
|
27 | - { |
|
25 | + function __get($name) { |
|
28 | 26 | return $this->_config['magestead']['apps']['mba_12345'][$name]; |
29 | 27 | } |
30 | 28 | |
@@ -32,8 +30,7 @@ discard block |
||
32 | 30 | * @param OutputInterface $output |
33 | 31 | * @return bool|mixed |
34 | 32 | */ |
35 | - protected function getConfigFile(OutputInterface $output) |
|
36 | - { |
|
33 | + protected function getConfigFile(OutputInterface $output) { |
|
37 | 34 | $config = new Parser(); |
38 | 35 | try { |
39 | 36 | return $config->parse($this->readConfigFile()); |
@@ -48,8 +45,7 @@ discard block |
||
48 | 45 | * @return string |
49 | 46 | * @throws MissingConfigFileException |
50 | 47 | */ |
51 | - protected function readConfigFile() |
|
52 | - { |
|
48 | + protected function readConfigFile() { |
|
53 | 49 | if (!file_exists($this->_projectPath . '/magestead.yaml')) { |
54 | 50 | throw new MissingConfigFileException('No config file was found, are you in the project root?'); |
55 | 51 | } |
@@ -58,6 +58,6 @@ |
||
58 | 58 | break; |
59 | 59 | } |
60 | 60 | |
61 | - return false; |
|
61 | + return FALSE; |
|
62 | 62 | } |
63 | 63 | } |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | */ |
16 | 16 | public function __construct(OutputInterface $output) |
17 | 17 | { |
18 | - $this->_projectPath = getcwd(); |
|
19 | - $this->_config = $this->getConfigFile($output); |
|
18 | + $this->_projectPath=getcwd(); |
|
19 | + $this->_config=$this->getConfigFile($output); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | protected function getConfigFile(OutputInterface $output) |
36 | 36 | { |
37 | - $config = new Parser(); |
|
37 | + $config=new Parser(); |
|
38 | 38 | try { |
39 | 39 | return $config->parse($this->readConfigFile()); |
40 | 40 | } catch (ParseException $e) { |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | */ |
51 | 51 | protected function readConfigFile() |
52 | 52 | { |
53 | - if (!file_exists($this->_projectPath . '/magestead.yaml')) { |
|
53 | + if (!file_exists($this->_projectPath.'/magestead.yaml')) { |
|
54 | 54 | throw new MissingConfigFileException('No config file was found, are you in the project root?'); |
55 | 55 | } |
56 | 56 | |
57 | - return file_get_contents($this->_projectPath . '/magestead.yaml'); |
|
57 | + return file_get_contents($this->_projectPath.'/magestead.yaml'); |
|
58 | 58 | } |
59 | 59 | } |
@@ -53,20 +53,20 @@ |
||
53 | 53 | public function getAllOptions() |
54 | 54 | { |
55 | 55 | return [ |
56 | - 'app' => $this->_app, |
|
57 | - 'server' => $this->_server, |
|
58 | - 'phpver' => $this->_phpVer, |
|
59 | - 'os' => $this->_os, |
|
60 | - 'box' => $this->_box, |
|
61 | - 'm2user' => $this->_m2Username, |
|
62 | - 'm2pass' => $this->_m2Password, |
|
63 | - 'repo_url' => $this->_repoUrl, |
|
64 | - 'ip_address' => $this->_ipAddress, |
|
65 | - 'cpus' => $this->_cpus, |
|
66 | - 'memory_limit' => $this->_memorylimit, |
|
67 | - 'locale' => $this->_locale, |
|
68 | - 'default_currency' => $this->_currency, |
|
69 | - 'base_url' => $this->_baseUrl, |
|
56 | + 'app' => $this->_app, |
|
57 | + 'server' => $this->_server, |
|
58 | + 'phpver' => $this->_phpVer, |
|
59 | + 'os' => $this->_os, |
|
60 | + 'box' => $this->_box, |
|
61 | + 'm2user' => $this->_m2Username, |
|
62 | + 'm2pass' => $this->_m2Password, |
|
63 | + 'repo_url' => $this->_repoUrl, |
|
64 | + 'ip_address' => $this->_ipAddress, |
|
65 | + 'cpus' => $this->_cpus, |
|
66 | + 'memory_limit' => $this->_memorylimit, |
|
67 | + 'locale' => $this->_locale, |
|
68 | + 'default_currency' => $this->_currency, |
|
69 | + 'base_url' => $this->_baseUrl, |
|
70 | 70 | ]; |
71 | 71 | } |
72 | 72 |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | return $this->verifyAuth($helper, $input, $output); |
129 | 129 | } |
130 | 130 | |
131 | - return true; |
|
131 | + return TRUE; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | /** |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) |
140 | 140 | { |
141 | - $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
|
141 | + $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", FALSE); |
|
142 | 142 | $versioning = $helper->ask($input, $output, $versionControl); |
143 | 143 | if ($versioning) { |
144 | 144 | $repoQuestion = new Question("Enter your full GitHub/BitBucket repo URL: ", ''); |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $authObj = (array)json_decode($authJson); |
177 | 177 | |
178 | 178 | if (isset($authObj['http-basic']) && isset($authObj['http-basic']->{'repo.magento.com'})) { |
179 | - return true; |
|
179 | + return TRUE; |
|
180 | 180 | } |
181 | 181 | } |
182 | 182 |
@@ -36,8 +36,7 @@ discard block |
||
36 | 36 | * @param OutputInterface $output |
37 | 37 | * @param $project |
38 | 38 | */ |
39 | - public function __construct($helper, InputInterface $input, OutputInterface $output, $project) |
|
40 | - { |
|
39 | + public function __construct($helper, InputInterface $input, OutputInterface $output, $project) { |
|
41 | 40 | $this->setVagrantSettings($helper, $input, $output); |
42 | 41 | |
43 | 42 | $this->setServerConfig($helper, $input, $output); |
@@ -52,8 +51,7 @@ discard block |
||
52 | 51 | /** |
53 | 52 | * @return array |
54 | 53 | */ |
55 | - public function getAllOptions() |
|
56 | - { |
|
54 | + public function getAllOptions() { |
|
57 | 55 | return [ |
58 | 56 | 'app' => $this->_app, |
59 | 57 | 'server' => $this->_server, |
@@ -77,8 +75,7 @@ discard block |
||
77 | 75 | * @param InputInterface $input |
78 | 76 | * @param OutputInterface $output |
79 | 77 | */ |
80 | - protected function setVagrantSettings($helper, InputInterface $input, OutputInterface $output) |
|
81 | - { |
|
78 | + protected function setVagrantSettings($helper, InputInterface $input, OutputInterface $output) { |
|
82 | 79 | $output->writeln('<comment>Lets configure your project\'s VM</comment>'); |
83 | 80 | |
84 | 81 | $ipQuestion = new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47'); |
@@ -97,8 +94,7 @@ discard block |
||
97 | 94 | * @param OutputInterface $output |
98 | 95 | * @param $project |
99 | 96 | */ |
100 | - protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output, $project) |
|
101 | - { |
|
97 | + protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output, $project) { |
|
102 | 98 | $output->writeln('<comment>Lets configure your project\'s application</comment>'); |
103 | 99 | if ($this->_phpVer !== '70') { |
104 | 100 | $appQuestion = new ChoiceQuestion( |
@@ -126,8 +122,7 @@ discard block |
||
126 | 122 | * @param OutputInterface $output |
127 | 123 | * @return boolean|integer |
128 | 124 | */ |
129 | - protected function setMagento2Settings($helper, InputInterface $input, OutputInterface $output) |
|
130 | - { |
|
125 | + protected function setMagento2Settings($helper, InputInterface $input, OutputInterface $output) { |
|
131 | 126 | if ($this->_app === 'magento2') { |
132 | 127 | return $this->verifyAuth($helper, $input, $output); |
133 | 128 | } |
@@ -140,8 +135,7 @@ discard block |
||
140 | 135 | * @param InputInterface $input |
141 | 136 | * @param OutputInterface $output |
142 | 137 | */ |
143 | - protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) |
|
144 | - { |
|
138 | + protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) { |
|
145 | 139 | $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
146 | 140 | $versioning = $helper->ask($input, $output, $versionControl); |
147 | 141 | if ($versioning) { |
@@ -155,8 +149,7 @@ discard block |
||
155 | 149 | * @param InputInterface $input |
156 | 150 | * @param OutputInterface $output |
157 | 151 | */ |
158 | - protected function askForAuth($helper, InputInterface $input, OutputInterface $output) |
|
159 | - { |
|
152 | + protected function askForAuth($helper, InputInterface $input, OutputInterface $output) { |
|
160 | 153 | $username = new Question("Please enter your Magento username (public key): ", ''); |
161 | 154 | $this->_m2Username = $helper->ask($input, $output, $username); |
162 | 155 | |
@@ -170,8 +163,7 @@ discard block |
||
170 | 163 | * @param OutputInterface $output |
171 | 164 | * @return boolean|integer |
172 | 165 | */ |
173 | - protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) |
|
174 | - { |
|
166 | + protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) { |
|
175 | 167 | $authFile = $_SERVER['HOME'] . "/.composer/auth.json"; |
176 | 168 | |
177 | 169 | $authObj = []; |
@@ -198,8 +190,7 @@ discard block |
||
198 | 190 | * @param InputInterface $input |
199 | 191 | * @param OutputInterface $output |
200 | 192 | */ |
201 | - protected function setPhp($helper, InputInterface $input, OutputInterface $output) |
|
202 | - { |
|
193 | + protected function setPhp($helper, InputInterface $input, OutputInterface $output) { |
|
203 | 194 | $output->writeln('<info>Keep in mind PHP7 is only available for Magento 2</info>'); |
204 | 195 | $phpVerQuestion = new ChoiceQuestion( |
205 | 196 | "Which version of PHP should be installed?", |
@@ -213,8 +204,7 @@ discard block |
||
213 | 204 | /** |
214 | 205 | * Set box name from concat user options |
215 | 206 | */ |
216 | - protected function setVagrantBox() |
|
217 | - { |
|
207 | + protected function setVagrantBox() { |
|
218 | 208 | $this->_box = self::BOX_PREFIX . $this->_os . "-$this->_server-php$this->_phpVer"; |
219 | 209 | } |
220 | 210 | |
@@ -223,8 +213,7 @@ discard block |
||
223 | 213 | * @param InputInterface $input |
224 | 214 | * @param OutputInterface $output |
225 | 215 | */ |
226 | - protected function setServerConfig($helper, InputInterface $input, OutputInterface $output) |
|
227 | - { |
|
216 | + protected function setServerConfig($helper, InputInterface $input, OutputInterface $output) { |
|
228 | 217 | $output->writeln('<comment>Lets configure your server</comment>'); |
229 | 218 | $this->setOperatingSystem($helper, $input, $output); |
230 | 219 | $this->setWebServer($helper, $input, $output); |
@@ -236,8 +225,7 @@ discard block |
||
236 | 225 | * @param InputInterface $input |
237 | 226 | * @param OutputInterface $output |
238 | 227 | */ |
239 | - protected function setWebServer($helper, InputInterface $input, OutputInterface $output) |
|
240 | - { |
|
228 | + protected function setWebServer($helper, InputInterface $input, OutputInterface $output) { |
|
241 | 229 | $serverQuestion = new ChoiceQuestion( |
242 | 230 | "Which webserver would you like?", |
243 | 231 | ['NGINX', 'Apache'], |
@@ -252,8 +240,7 @@ discard block |
||
252 | 240 | * @param InputInterface $input |
253 | 241 | * @param OutputInterface $output |
254 | 242 | */ |
255 | - protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) |
|
256 | - { |
|
243 | + protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) { |
|
257 | 244 | $osQuestion = new ChoiceQuestion( |
258 | 245 | "Which OS would you like to install?", |
259 | 246 | ['CentOS 6.5', 'Ubuntu 14'], |
@@ -12,11 +12,11 @@ discard block |
||
12 | 12 | */ |
13 | 13 | class Options |
14 | 14 | { |
15 | - const BOX_PREFIX = 'richdynamix/magestead-'; |
|
15 | + const BOX_PREFIX='richdynamix/magestead-'; |
|
16 | 16 | |
17 | - protected $_app = 'magento2'; |
|
18 | - protected $_phpVer = '56'; |
|
19 | - protected $_os = 'centos65'; |
|
17 | + protected $_app='magento2'; |
|
18 | + protected $_phpVer='56'; |
|
19 | + protected $_os='centos65'; |
|
20 | 20 | protected $_server; |
21 | 21 | protected $_box; |
22 | 22 | protected $_m2Username; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | protected $_locale; |
28 | 28 | protected $_currency; |
29 | 29 | protected $_baseUrl; |
30 | - protected $_repoUrl = ''; |
|
30 | + protected $_repoUrl=''; |
|
31 | 31 | |
32 | 32 | /** |
33 | 33 | * Options constructor. |
@@ -81,14 +81,14 @@ discard block |
||
81 | 81 | { |
82 | 82 | $output->writeln('<comment>Lets configure your project\'s VM</comment>'); |
83 | 83 | |
84 | - $ipQuestion = new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47'); |
|
85 | - $this->_ipAddress = strtolower($helper->ask($input, $output, $ipQuestion)); |
|
84 | + $ipQuestion=new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47'); |
|
85 | + $this->_ipAddress=strtolower($helper->ask($input, $output, $ipQuestion)); |
|
86 | 86 | |
87 | - $cpuQuestion = new Question("How many CPU's would you like to use? (1): ", '1'); |
|
88 | - $this->_cpus = strtolower($helper->ask($input, $output, $cpuQuestion)); |
|
87 | + $cpuQuestion=new Question("How many CPU's would you like to use? (1): ", '1'); |
|
88 | + $this->_cpus=strtolower($helper->ask($input, $output, $cpuQuestion)); |
|
89 | 89 | |
90 | - $memoryQuestion = new Question("Define the VM memory limit (2048): ", '2048'); |
|
91 | - $this->_memorylimit = strtolower($helper->ask($input, $output, $memoryQuestion)); |
|
90 | + $memoryQuestion=new Question("Define the VM memory limit (2048): ", '2048'); |
|
91 | + $this->_memorylimit=strtolower($helper->ask($input, $output, $memoryQuestion)); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -100,22 +100,22 @@ discard block |
||
100 | 100 | protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output, $project) |
101 | 101 | { |
102 | 102 | $output->writeln('<comment>Lets configure your project\'s application</comment>'); |
103 | - $appQuestion = new ChoiceQuestion( |
|
103 | + $appQuestion=new ChoiceQuestion( |
|
104 | 104 | "Which application do you want to install?", |
105 | 105 | ['Magento', 'Magento2'], |
106 | 106 | 0 |
107 | 107 | ); |
108 | 108 | |
109 | - $this->_app = strtolower($helper->ask($input, $output, $appQuestion)); |
|
109 | + $this->_app=strtolower($helper->ask($input, $output, $appQuestion)); |
|
110 | 110 | |
111 | - $baseUrlQuestion = new Question("Enter your application's base_url ($project.dev): ", $project.'.dev'); |
|
112 | - $this->_baseUrl = strtolower($helper->ask($input, $output, $baseUrlQuestion)); |
|
111 | + $baseUrlQuestion=new Question("Enter your application's base_url ($project.dev): ", $project.'.dev'); |
|
112 | + $this->_baseUrl=strtolower($helper->ask($input, $output, $baseUrlQuestion)); |
|
113 | 113 | |
114 | - $currenyQuestion = new Question("Enter your application's default currency (GBP): ", 'GBP'); |
|
115 | - $this->_currency = $helper->ask($input, $output, $currenyQuestion); |
|
114 | + $currenyQuestion=new Question("Enter your application's default currency (GBP): ", 'GBP'); |
|
115 | + $this->_currency=$helper->ask($input, $output, $currenyQuestion); |
|
116 | 116 | |
117 | - $localeQuestion = new Question("Enter your application's default locale (en_GB): ", 'en_GB'); |
|
118 | - $this->_locale = $helper->ask($input, $output, $localeQuestion); |
|
117 | + $localeQuestion=new Question("Enter your application's default locale (en_GB): ", 'en_GB'); |
|
118 | + $this->_locale=$helper->ask($input, $output, $localeQuestion); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
@@ -140,11 +140,11 @@ discard block |
||
140 | 140 | */ |
141 | 141 | protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) |
142 | 142 | { |
143 | - $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
|
144 | - $versioning = $helper->ask($input, $output, $versionControl); |
|
143 | + $versionControl=new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
|
144 | + $versioning=$helper->ask($input, $output, $versionControl); |
|
145 | 145 | if ($versioning) { |
146 | - $repoQuestion = new Question("Enter your full GitHub/BitBucket repo URL: ", ''); |
|
147 | - $this->_repoUrl = strtolower($helper->ask($input, $output, $repoQuestion)); |
|
146 | + $repoQuestion=new Question("Enter your full GitHub/BitBucket repo URL: ", ''); |
|
147 | + $this->_repoUrl=strtolower($helper->ask($input, $output, $repoQuestion)); |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
@@ -155,11 +155,11 @@ discard block |
||
155 | 155 | */ |
156 | 156 | protected function askForAuth($helper, InputInterface $input, OutputInterface $output) |
157 | 157 | { |
158 | - $username = new Question("Please enter your Magento username (public key): ", ''); |
|
159 | - $this->_m2Username = $helper->ask($input, $output, $username); |
|
158 | + $username=new Question("Please enter your Magento username (public key): ", ''); |
|
159 | + $this->_m2Username=$helper->ask($input, $output, $username); |
|
160 | 160 | |
161 | - $password = new Question("Please enter your Magento password (private key): ", ''); |
|
162 | - $this->_m2Password = $helper->ask($input, $output, $password); |
|
161 | + $password=new Question("Please enter your Magento password (private key): ", ''); |
|
162 | + $this->_m2Password=$helper->ask($input, $output, $password); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -170,12 +170,12 @@ discard block |
||
170 | 170 | */ |
171 | 171 | protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) |
172 | 172 | { |
173 | - $authFile = $_SERVER['HOME'] . "/.composer/auth.json"; |
|
173 | + $authFile=$_SERVER['HOME']."/.composer/auth.json"; |
|
174 | 174 | |
175 | - $authObj = []; |
|
175 | + $authObj=[]; |
|
176 | 176 | if (file_exists($authFile)) { |
177 | - $authJson = file_get_contents($authFile); |
|
178 | - $authObj = (array)json_decode($authJson); |
|
177 | + $authJson=file_get_contents($authFile); |
|
178 | + $authObj=(array) json_decode($authJson); |
|
179 | 179 | |
180 | 180 | if (isset($authObj['http-basic']) && isset($authObj['http-basic']->{'repo.magento.com'})) { |
181 | 181 | return true; |
@@ -184,10 +184,10 @@ discard block |
||
184 | 184 | |
185 | 185 | $this->askForAuth($helper, $input, $output); |
186 | 186 | |
187 | - $authObj['http-basic']['repo.magento.com']['username'] = $this->_m2Username; |
|
188 | - $authObj['http-basic']['repo.magento.com']['password'] = $this->_m2Password; |
|
187 | + $authObj['http-basic']['repo.magento.com']['username']=$this->_m2Username; |
|
188 | + $authObj['http-basic']['repo.magento.com']['password']=$this->_m2Password; |
|
189 | 189 | |
190 | - $authJson = json_encode($authObj); |
|
190 | + $authJson=json_encode($authObj); |
|
191 | 191 | return file_put_contents($authFile, $authJson); |
192 | 192 | } |
193 | 193 | |
@@ -199,13 +199,13 @@ discard block |
||
199 | 199 | protected function setPhp($helper, InputInterface $input, OutputInterface $output) |
200 | 200 | { |
201 | 201 | $output->writeln('<info>Keep in mind PHP7 is only available for Magento 2</info>'); |
202 | - $phpVerQuestion = new ChoiceQuestion( |
|
202 | + $phpVerQuestion=new ChoiceQuestion( |
|
203 | 203 | "Which version of PHP should be installed?", |
204 | 204 | ['56', '70'], |
205 | 205 | 0 |
206 | 206 | ); |
207 | 207 | |
208 | - $this->_phpVer = $helper->ask($input, $output, $phpVerQuestion); |
|
208 | + $this->_phpVer=$helper->ask($input, $output, $phpVerQuestion); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | protected function setVagrantBox() |
215 | 215 | { |
216 | - $this->_box = self::BOX_PREFIX . $this->_os . "-$this->_server-php$this->_phpVer"; |
|
216 | + $this->_box=self::BOX_PREFIX.$this->_os."-$this->_server-php$this->_phpVer"; |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
@@ -236,13 +236,13 @@ discard block |
||
236 | 236 | */ |
237 | 237 | protected function setWebServer($helper, InputInterface $input, OutputInterface $output) |
238 | 238 | { |
239 | - $serverQuestion = new ChoiceQuestion( |
|
239 | + $serverQuestion=new ChoiceQuestion( |
|
240 | 240 | "Which webserver would you like?", |
241 | 241 | ['NGINX', 'Apache'], |
242 | 242 | 0 |
243 | 243 | ); |
244 | 244 | |
245 | - $this->_server = strtolower($helper->ask($input, $output, $serverQuestion)); |
|
245 | + $this->_server=strtolower($helper->ask($input, $output, $serverQuestion)); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | /** |
@@ -252,12 +252,12 @@ discard block |
||
252 | 252 | */ |
253 | 253 | protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) |
254 | 254 | { |
255 | - $osQuestion = new ChoiceQuestion( |
|
255 | + $osQuestion=new ChoiceQuestion( |
|
256 | 256 | "Which OS would you like to install?", |
257 | 257 | ['CentOS 6.5', 'Ubuntu 14'], |
258 | 258 | 0 |
259 | 259 | ); |
260 | 260 | |
261 | - $this->_os = str_replace(' ', '', str_replace('.', '', strtolower($helper->ask($input, $output, $osQuestion)))); |
|
261 | + $this->_os=str_replace(' ', '', str_replace('.', '', strtolower($helper->ask($input, $output, $osQuestion)))); |
|
262 | 262 | } |
263 | 263 | } |
264 | 264 | \ No newline at end of file |