Completed
Pull Request — develop (#102)
by
unknown
03:39
created
src/Magestead/Command/NewCommand.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 
26 26
     protected function configure()
27 27
     {
28
-        $this->_basePath    = dirname( __FILE__ ) . '/../../../';
29
-        $this->_projectPath = getcwd();
28
+        $this->_basePath=dirname(__FILE__).'/../../../';
29
+        $this->_projectPath=getcwd();
30 30
 
31 31
         $this->setName("new");
32 32
         $this->setDescription("Initialise new Magestead project into current working directory");
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
      */
42 42
     protected function execute(InputInterface $input, OutputInterface $output)
43 43
     {
44
-        $project = $this->setProject($input);
44
+        $project=$this->setProject($input);
45 45
 
46
-        $helper  = $this->getHelper('question');
47
-        $options = (new Options($helper, $input, $output, $project))->getAllOptions();
46
+        $helper=$this->getHelper('question');
47
+        $options=(new Options($helper, $input, $output, $project))->getAllOptions();
48 48
 
49 49
         $this->setupProject($output, $options);
50 50
 
@@ -62,17 +62,17 @@  discard block
 block discarded – undo
62 62
     protected function copyConfigFiles($source, $target, OutputInterface $output)
63 63
     {
64 64
         try {
65
-            $progress = new ProgressBar($output, 3720);
65
+            $progress=new ProgressBar($output, 3720);
66 66
             $progress->start();
67 67
             foreach (
68
-                $iterator = new \RecursiveIteratorIterator(
68
+                $iterator=new \RecursiveIteratorIterator(
69 69
                     new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS),
70 70
                     \RecursiveIteratorIterator::SELF_FIRST) as $item
71 71
             ) {
72 72
                 if ($item->isDir()) {
73
-                    mkdir($target . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
73
+                    mkdir($target.DIRECTORY_SEPARATOR.$iterator->getSubPathName());
74 74
                 } else {
75
-                    copy($item, $target . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
75
+                    copy($item, $target.DIRECTORY_SEPARATOR.$iterator->getSubPathName());
76 76
                 }
77 77
                 $progress->advance();
78 78
             }
@@ -89,24 +89,24 @@  discard block
 block discarded – undo
89 89
      */
90 90
     protected function configureProject(array $options, OutputInterface $output)
91 91
     {
92
-        $msConfig = $this->getConfigFile($output);
92
+        $msConfig=$this->getConfigFile($output);
93 93
 
94
-        $app = ($options['app'] == 'magento2') ? 'magento2' : 'magento';
95
-        $hostname = 'magestead-' . $options['base_url'];
94
+        $app=($options['app'] == 'magento2') ? 'magento2' : 'magento';
95
+        $hostname='magestead-'.$options['base_url'];
96 96
 
97
-        $msConfig['vagrantfile']['vm']['box']                           = $options['box'];
98
-        $msConfig['vagrantfile']['vm']['box_url']                       = $options['box'];
99
-        $msConfig['vagrantfile']['vm']['hostname']                      = $hostname;
100
-        $msConfig['vagrantfile']['vm']['memory']                        = $options['memory_limit'];
101
-        $msConfig['vagrantfile']['vm']['network']['private_network']    = $options['ip_address'];
102
-        $msConfig['magestead']['apps']['mba_12345']['type']             = $app;
103
-        $msConfig['magestead']['apps']['mba_12345']['locale']           = $options['locale'];
104
-        $msConfig['magestead']['apps']['mba_12345']['default_currency'] = $options['default_currency'];
105
-        $msConfig['magestead']['apps']['mba_12345']['base_url']         = $options['base_url'];
106
-        $msConfig['magestead']['os']                                    = $options['os'];
107
-        $msConfig['magestead']['server']                                = $options['server'];
97
+        $msConfig['vagrantfile']['vm']['box']=$options['box'];
98
+        $msConfig['vagrantfile']['vm']['box_url']=$options['box'];
99
+        $msConfig['vagrantfile']['vm']['hostname']=$hostname;
100
+        $msConfig['vagrantfile']['vm']['memory']=$options['memory_limit'];
101
+        $msConfig['vagrantfile']['vm']['network']['private_network']=$options['ip_address'];
102
+        $msConfig['magestead']['apps']['mba_12345']['type']=$app;
103
+        $msConfig['magestead']['apps']['mba_12345']['locale']=$options['locale'];
104
+        $msConfig['magestead']['apps']['mba_12345']['default_currency']=$options['default_currency'];
105
+        $msConfig['magestead']['apps']['mba_12345']['base_url']=$options['base_url'];
106
+        $msConfig['magestead']['os']=$options['os'];
107
+        $msConfig['magestead']['server']=$options['server'];
108 108
 
109
-        $this->_msConfig = $msConfig;
109
+        $this->_msConfig=$msConfig;
110 110
 
111 111
         $this->saveConfigFile($msConfig, $output);
112 112
 
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
      */
119 119
     protected function getConfigFile(OutputInterface $output)
120 120
     {
121
-        $yaml = new Parser();
121
+        $yaml=new Parser();
122 122
         try {
123
-            return $yaml->parse(file_get_contents($this->_projectPath . '/magestead.yaml'));
123
+            return $yaml->parse(file_get_contents($this->_projectPath.'/magestead.yaml'));
124 124
         } catch (ParseException $e) {
125 125
             $output->writeln('<error>Unable to parse the YAML string</error>');
126 126
             printf("Unable to parse the YAML string: %s", $e->getMessage());
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
      */
134 134
     protected function saveConfigFile(array $config, OutputInterface $output)
135 135
     {
136
-        $dumper = new Dumper();
137
-        $yaml   = $dumper->dump($config, 6);
136
+        $dumper=new Dumper();
137
+        $yaml=$dumper->dump($config, 6);
138 138
 
139 139
         try {
140
-            file_put_contents($this->_projectPath . '/magestead.yaml', $yaml);
140
+            file_put_contents($this->_projectPath.'/magestead.yaml', $yaml);
141 141
         } catch (\Exception $e) {
142 142
             $output->writeln('<error>Unable to write to the YAML file</error>');
143 143
         }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     protected function setupProject(OutputInterface $output, $options)
151 151
     {
152 152
         $output->writeln('<info>Setting up project structure</info>');
153
-        $provisionFolder = $this->_basePath . "provision";
153
+        $provisionFolder=$this->_basePath."provision";
154 154
         $this->copyConfigFiles($provisionFolder, $this->_projectPath, $output);
155 155
         $this->configureProject($options, $output);
156 156
 
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
      */
165 165
     protected function setProject(InputInterface $input)
166 166
     {
167
-        $project = $input->getArgument('project');
168
-        $this->_projectPath = $this->_projectPath . '/' . $project;
167
+        $project=$input->getArgument('project');
168
+        $this->_projectPath=$this->_projectPath.'/'.$project;
169 169
 
170 170
 
171 171
         if (is_dir($this->_projectPath)) {
Please login to merge, or discard this patch.
src/Magestead/Command/UpdateCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
      */
19 19
     public function configure()
20 20
     {
21
-        $this->projectPath = getcwd();
21
+        $this->projectPath=getcwd();
22 22
 
23 23
         $this->setName("self-update");
24 24
         $this->setDescription("Check for new updates for Magestead CLI");
Please login to merge, or discard this patch.
src/Magestead/Installers/Magento2Project.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function __construct(array $options, array $config, $projectPath, OutputInterface $output)
30 30
     {
31
-        $this->output = $output;
31
+        $this->output=$output;
32 32
         $this->composerInstall($projectPath, $output);
33 33
         $this->installMagento($config, $options, $projectPath, $output);
34 34
         $this->finaliseSetup($options, $projectPath, $output);
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     protected function composerInstall($projectPath, OutputInterface $output)
45 45
     {
46 46
         $output->writeln('<info>Installing Magento 2 with Composer</info>');
47
-        $command = 'composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition public';
47
+        $command='composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition public';
48 48
         new ProcessCommand($command, $projectPath, $output);
49 49
 
50 50
         $this->copyAuthFile($projectPath);
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
      */
60 60
     protected function copyAuthFile($destination)
61 61
     {
62
-        $composerHome = (new Config($this->output))->getComposerHomeDir();
63
-        $authFile = $composerHome . "/auth.json";
62
+        $composerHome=(new Config($this->output))->getComposerHomeDir();
63
+        $authFile=$composerHome."/auth.json";
64 64
 
65
-        return copy($authFile, $destination . '/public/auth.json');
65
+        return copy($authFile, $destination.'/public/auth.json');
66 66
     }
67 67
 
68 68
     /**
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     protected function addPhpSpecPackage($projectPath, OutputInterface $output)
73 73
     {
74 74
         $output->writeln('<comment>Installing PHPSpec</comment>');
75
-        $command = 'cd '.$projectPath.'/public; composer require phpspec/phpspec --dev;';
75
+        $command='cd '.$projectPath.'/public; composer require phpspec/phpspec --dev;';
76 76
         new ProcessCommand($command, $projectPath, $output);
77 77
 
78 78
         $this->setPhpSpecPermissions($projectPath, $output);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     protected function addBehatPackage($projectPath, OutputInterface $output)
86 86
     {
87 87
         $output->writeln('<comment>Installing Behat</comment>');
88
-        $command = 'cd '.$projectPath.'/public; composer require behat/behat --dev;';
88
+        $command='cd '.$projectPath.'/public; composer require behat/behat --dev;';
89 89
         new ProcessCommand($command, $projectPath, $output);
90 90
 
91 91
         $this->setBehatPermissions($projectPath, $output);
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
         $this->installSampleData($options, $projectPath, $output);
105 105
 
106 106
         $output->writeln('<info>Installing Magento 2 Software</info>');
107
-        $locale           = $config['magestead']['apps']['mba_12345']['locale'];
108
-        $db_name          = $config['magestead']['apps']['mba_12345']['db_name'];
109
-        $base_url         = $config['magestead']['apps']['mba_12345']['base_url'];
110
-        $default_currency = $config['magestead']['apps']['mba_12345']['default_currency'];
107
+        $locale=$config['magestead']['apps']['mba_12345']['locale'];
108
+        $db_name=$config['magestead']['apps']['mba_12345']['db_name'];
109
+        $base_url=$config['magestead']['apps']['mba_12345']['base_url'];
110
+        $default_currency=$config['magestead']['apps']['mba_12345']['default_currency'];
111 111
 
112
-        $install = 'vagrant ssh -c \'cd /var/www/public; bin/magento setup:install --base-url=http://'.$base_url.'/ \
112
+        $install='vagrant ssh -c \'cd /var/www/public; bin/magento setup:install --base-url=http://'.$base_url.'/ \
113 113
 --db-host=localhost \
114 114
 --db-name='.$db_name.' \
115 115
 --db-user=magestead \
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     {
139 139
         if (true === $options['installSampleData']) {
140 140
             $output->writeln('<info>Installing Magento 2 Sample Data</info>');
141
-            $deployCommand = 'vagrant ssh -c \'cd /var/www/public; bin/magento sampledata:deploy \'';
141
+            $deployCommand='vagrant ssh -c \'cd /var/www/public; bin/magento sampledata:deploy \'';
142 142
             new ProcessCommand($deployCommand, $projectPath, $output);
143 143
         }
144 144
     }
@@ -150,15 +150,15 @@  discard block
 block discarded – undo
150 150
     protected function setPermissions($projectPath, OutputInterface $output)
151 151
     {
152 152
         $output->writeln('<info>Setting Permissions</info>');
153
-        $command = 'vagrant ssh -c \'cd /var/www/public; sudo find . -type d -exec chmod 700 {} \;\'';
153
+        $command='vagrant ssh -c \'cd /var/www/public; sudo find . -type d -exec chmod 700 {} \;\'';
154 154
         new ProcessCommand($command, $projectPath, $output);
155 155
         $output->writeln('<comment>Folder Permissions Set</comment>');
156 156
 
157
-        $command = 'vagrant ssh -c \'cd /var/www/public; sudo find . -type f -exec chmod 600 {} \;\'';
157
+        $command='vagrant ssh -c \'cd /var/www/public; sudo find . -type f -exec chmod 600 {} \;\'';
158 158
         new ProcessCommand($command, $projectPath, $output);
159 159
         $output->writeln('<comment>File Permissions Set</comment>');
160 160
 
161
-        $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod +x bin/magento; sudo chmod 755 bin/phpspec; sudo chmod 755 bin/behat;\'';
161
+        $command='vagrant ssh -c \'cd /var/www/public; sudo chmod +x bin/magento; sudo chmod 755 bin/phpspec; sudo chmod 755 bin/behat;\'';
162 162
         new ProcessCommand($command, $projectPath, $output);
163 163
         $output->writeln('<comment>bin/magento Permissions Set</comment>');
164 164
     }
@@ -170,10 +170,10 @@  discard block
 block discarded – undo
170 170
     protected function configureRedis($projectPath, OutputInterface $output)
171 171
     {
172 172
         $output->writeln('<comment>Configuring Redis Cache</comment>');
173
-        $file = "$projectPath/public/app/etc/env.php";
174
-        $env  = include $file;
173
+        $file="$projectPath/public/app/etc/env.php";
174
+        $env=include $file;
175 175
 
176
-        $env['cache'] = [
176
+        $env['cache']=[
177 177
             'frontend' => [
178 178
                 'default' => [
179 179
                     'backend' => 'Cm_Cache_Backend_Redis',
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
             ],
213 213
         ];
214 214
 
215
-        file_put_contents($file, "<?php \n \n return ".var_export($env,true).";");
215
+        file_put_contents($file, "<?php \n \n return ".var_export($env, true).";");
216 216
     }
217 217
 
218 218
     /**
@@ -222,11 +222,11 @@  discard block
 block discarded – undo
222 222
      */
223 223
     protected function finaliseSetup(array $options, $projectPath, OutputInterface $output)
224 224
     {
225
-        $command = 'vagrant ssh -c \'cd /var/www/public; bin/magento indexer:reindex; \'';
225
+        $command='vagrant ssh -c \'cd /var/www/public; bin/magento indexer:reindex; \'';
226 226
         $output->writeln('<comment>Reindexing Tables</comment>');
227 227
         new ProcessCommand($command, $projectPath, $output);
228 228
 
229
-        $command = 'vagrant ssh -c \'cd /var/www/public; bin/magento cache:flush;\'';
229
+        $command='vagrant ssh -c \'cd /var/www/public; bin/magento cache:flush;\'';
230 230
         $output->writeln('<comment>Flushing All Cache</comment>');
231 231
         new ProcessCommand($command, $projectPath, $output);
232 232
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
     protected function showCredentials(array $options, OutputInterface $output)
242 242
     {
243 243
         $output->writeln('<info>SUCCESS: Magestead has finished installing Magento 2!</info>');
244
-        $table = new Table($output);
244
+        $table=new Table($output);
245 245
         $table
246 246
             ->setHeaders(['Username', 'Password', 'Base URL', 'Admin URI'])
247 247
             ->setRows([
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
     protected function processVcs(array $options, $projectPath, OutputInterface $output)
262 262
     {
263 263
         if (!empty($options['repo_url'])) {
264
-            copy($projectPath . "/puphpet/magestead/magento2/stubs/gitignore.tmp", $projectPath . "/.gitignore");
264
+            copy($projectPath."/puphpet/magestead/magento2/stubs/gitignore.tmp", $projectPath."/.gitignore");
265 265
             return new VersionControl($options['repo_url'], $projectPath, $output);
266 266
         }
267 267
     }
@@ -271,10 +271,10 @@  discard block
 block discarded – undo
271 271
      */
272 272
     protected function setComposerBinDir($projectPath)
273 273
     {
274
-        $file     = "$projectPath/public/composer.json";
275
-        $composer = json_decode(file_get_contents($file), true);
274
+        $file="$projectPath/public/composer.json";
275
+        $composer=json_decode(file_get_contents($file), true);
276 276
 
277
-        $composer['config']['bin-dir'] = 'bin';
277
+        $composer['config']['bin-dir']='bin';
278 278
         file_put_contents($file, json_encode($composer));
279 279
     }
280 280
 
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
      */
285 285
     protected function setPhpSpecPermissions($projectPath, OutputInterface $output)
286 286
     {
287
-        $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/phpspec; bin/phpspec run\'';
287
+        $command='vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/phpspec; bin/phpspec run\'';
288 288
         new ProcessCommand($command, $projectPath, $output);
289 289
     }
290 290
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
      */
295 295
     protected function setBehatPermissions($projectPath, OutputInterface $output)
296 296
     {
297
-        $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/behat; bin/behat --init\'';
297
+        $command='vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/behat; bin/behat --init\'';
298 298
         new ProcessCommand($command, $projectPath, $output);
299 299
     }
300 300
 }
301 301
\ No newline at end of file
Please login to merge, or discard this patch.
src/Magestead/Exceptions/AuthSavePermissionsException.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  */
7 7
 class AuthSavePermissionsException extends \RuntimeException
8 8
 {
9
-    const TPL = "\n\nFile auth.json is not writable. Please add the following content manually: \n%s\n";
9
+    const TPL="\n\nFile auth.json is not writable. Please add the following content manually: \n%s\n";
10 10
 
11 11
     /**
12 12
      * @param array $auth
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
      */
15 15
     public function setAuthObject(array $auth)
16 16
     {
17
-        $this->message = sprintf(static::TPL, json_encode($auth, JSON_PRETTY_PRINT));
17
+        $this->message=sprintf(static::TPL, json_encode($auth, JSON_PRETTY_PRINT));
18 18
         return $this;
19 19
     }
20 20
 }
Please login to merge, or discard this patch.
src/Magestead/Helper/Config.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public function __construct(OutputInterface $output)
25 25
     {
26
-        $this->_projectPath = getcwd();
27
-        $this->output = $output;
26
+        $this->_projectPath=getcwd();
27
+        $this->output=$output;
28 28
     }
29 29
 
30 30
     /**
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     function __get($name)
35 35
     {
36
-        $this->_config = $this->getConfigFile($this->output);
36
+        $this->_config=$this->getConfigFile($this->output);
37 37
         return $this->_config['magestead']['apps']['mba_12345'][$name];
38 38
     }
39 39
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      */
44 44
     protected function getConfigFile(OutputInterface $output)
45 45
     {
46
-        $config = new Parser();
46
+        $config=new Parser();
47 47
         try {
48 48
             return $config->parse($this->readConfigFile());
49 49
         } catch (ParseException $e) {
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
      */
60 60
     protected function readConfigFile()
61 61
     {
62
-        if (!file_exists($this->_projectPath . '/magestead.yaml')) {
62
+        if (!file_exists($this->_projectPath.'/magestead.yaml')) {
63 63
             throw new MissingConfigFileException('No config file was found, are you in the project root?');
64 64
         }
65 65
 
66
-        return file_get_contents($this->_projectPath . '/magestead.yaml');
66
+        return file_get_contents($this->_projectPath.'/magestead.yaml');
67 67
     }
68 68
 
69 69
     /**
@@ -74,15 +74,15 @@  discard block
 block discarded – undo
74 74
      */
75 75
     public function getComposerHomeDir()
76 76
     {
77
-        $composerConfig = shell_exec('composer config --list --global | grep "\[home\]"');
78
-        $composerConfig = array_filter(explode(PHP_EOL, $composerConfig));
77
+        $composerConfig=shell_exec('composer config --list --global | grep "\[home\]"');
78
+        $composerConfig=array_filter(explode(PHP_EOL, $composerConfig));
79 79
 
80 80
         foreach ($composerConfig as $line) {
81
-            $parts = array_filter(explode(" ", $line));
82
-            $composerConfig[$parts[0]] = $parts[1];
81
+            $parts=array_filter(explode(" ", $line));
82
+            $composerConfig[$parts[0]]=$parts[1];
83 83
         }
84 84
 
85
-        $composerHomePath = realpath(trim($composerConfig['[home]']));
85
+        $composerHomePath=realpath(trim($composerConfig['[home]']));
86 86
 
87 87
         if (false === $composerHomePath) {
88 88
             throw new MissingComposerHomeException('Composer home directory is not found. Do you have it installed?');
Please login to merge, or discard this patch.
src/Magestead/Helper/Options.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
  */
14 14
 class Options
15 15
 {
16
-    const BOX_PREFIX = 'richdynamix/magestead-';
16
+    const BOX_PREFIX='richdynamix/magestead-';
17 17
 
18
-    protected $_app = 'magento2';
19
-    protected $_phpVer = '56';
20
-    protected $_os = 'centos65';
18
+    protected $_app='magento2';
19
+    protected $_phpVer='56';
20
+    protected $_os='centos65';
21 21
     protected $_server;
22 22
     protected $_box;
23 23
     protected $_m2Username;
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
     protected $_locale;
29 29
     protected $_currency;
30 30
     protected $_baseUrl;
31
-    protected $_repoUrl = '';
32
-    protected $installSampleData = false;
31
+    protected $_repoUrl='';
32
+    protected $installSampleData=false;
33 33
 
34 34
     /**
35 35
      * Options constructor.
@@ -84,14 +84,14 @@  discard block
 block discarded – undo
84 84
     {
85 85
         $output->writeln('<comment>Lets configure your project\'s VM</comment>');
86 86
 
87
-        $ipQuestion       = new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47');
88
-        $this->_ipAddress = strtolower($helper->ask($input, $output, $ipQuestion));
87
+        $ipQuestion=new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47');
88
+        $this->_ipAddress=strtolower($helper->ask($input, $output, $ipQuestion));
89 89
 
90
-        $cpuQuestion = new Question("How many CPU's would you like to use? (1): ", '1');
91
-        $this->_cpus = strtolower($helper->ask($input, $output, $cpuQuestion));
90
+        $cpuQuestion=new Question("How many CPU's would you like to use? (1): ", '1');
91
+        $this->_cpus=strtolower($helper->ask($input, $output, $cpuQuestion));
92 92
 
93
-        $memoryQuestion     = new Question("Define the VM memory limit (2048): ", '2048');
94
-        $this->_memorylimit = strtolower($helper->ask($input, $output, $memoryQuestion));
93
+        $memoryQuestion=new Question("Define the VM memory limit (2048): ", '2048');
94
+        $this->_memorylimit=strtolower($helper->ask($input, $output, $memoryQuestion));
95 95
     }
96 96
 
97 97
     /**
@@ -103,22 +103,22 @@  discard block
 block discarded – undo
103 103
     protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output, $project)
104 104
     {
105 105
         $output->writeln('<comment>Lets configure your project\'s application</comment>');
106
-        $appQuestion = new ChoiceQuestion(
106
+        $appQuestion=new ChoiceQuestion(
107 107
             "Which application do you want to install?",
108 108
             ['Magento', 'Magento2'],
109 109
             0
110 110
         );
111 111
 
112
-        $this->_app = strtolower($helper->ask($input, $output, $appQuestion));
112
+        $this->_app=strtolower($helper->ask($input, $output, $appQuestion));
113 113
 
114
-        $baseUrlQuestion = new Question("Enter your application's base_url ($project.dev): ", $project.'.dev');
115
-        $this->_baseUrl  = strtolower($helper->ask($input, $output, $baseUrlQuestion));
114
+        $baseUrlQuestion=new Question("Enter your application's base_url ($project.dev): ", $project.'.dev');
115
+        $this->_baseUrl=strtolower($helper->ask($input, $output, $baseUrlQuestion));
116 116
 
117
-        $currenyQuestion = new Question("Enter your application's default currency (GBP): ", 'GBP');
118
-        $this->_currency = $helper->ask($input, $output, $currenyQuestion);
117
+        $currenyQuestion=new Question("Enter your application's default currency (GBP): ", 'GBP');
118
+        $this->_currency=$helper->ask($input, $output, $currenyQuestion);
119 119
 
120
-        $localeQuestion = new Question("Enter your application's default locale (en_GB): ", 'en_GB');
121
-        $this->_locale  = $helper->ask($input, $output, $localeQuestion);
120
+        $localeQuestion=new Question("Enter your application's default locale (en_GB): ", 'en_GB');
121
+        $this->_locale=$helper->ask($input, $output, $localeQuestion);
122 122
     }
123 123
 
124 124
     /**
@@ -144,18 +144,18 @@  discard block
 block discarded – undo
144 144
      */
145 145
     protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output)
146 146
     {
147
-        $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false);
148
-        $versioning     = $helper->ask($input, $output, $versionControl);
147
+        $versionControl=new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false);
148
+        $versioning=$helper->ask($input, $output, $versionControl);
149 149
         if ($versioning) {
150
-            $repoQuestion   = new Question("Enter your full GitHub/BitBucket repo URL: ", '');
151
-            $this->_repoUrl = strtolower($helper->ask($input, $output, $repoQuestion));
150
+            $repoQuestion=new Question("Enter your full GitHub/BitBucket repo URL: ", '');
151
+            $this->_repoUrl=strtolower($helper->ask($input, $output, $repoQuestion));
152 152
         }
153 153
     }
154 154
 
155 155
     protected function installSampleData($helper, InputInterface $input, OutputInterface $output)
156 156
     {
157
-        $sampleInstall = new ConfirmationQuestion("Would you like to install sample data? (no/yes) ", false);
158
-        $this->installSampleData = $helper->ask($input, $output, $sampleInstall);
157
+        $sampleInstall=new ConfirmationQuestion("Would you like to install sample data? (no/yes) ", false);
158
+        $this->installSampleData=$helper->ask($input, $output, $sampleInstall);
159 159
     }
160 160
 
161 161
     /**
@@ -165,11 +165,11 @@  discard block
 block discarded – undo
165 165
      */
166 166
     protected function askForAuth($helper, InputInterface $input, OutputInterface $output)
167 167
     {
168
-        $username          = new Question("Please enter your Magento username (public key): ", '');
169
-        $this->_m2Username = $helper->ask($input, $output, $username);
168
+        $username=new Question("Please enter your Magento username (public key): ", '');
169
+        $this->_m2Username=$helper->ask($input, $output, $username);
170 170
 
171
-        $password          = new Question("Please enter your Magento password (private key): ", '');
172
-        $this->_m2Password = $helper->ask($input, $output, $password);
171
+        $password=new Question("Please enter your Magento password (private key): ", '');
172
+        $this->_m2Password=$helper->ask($input, $output, $password);
173 173
     }
174 174
 
175 175
     /**
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
      */
181 181
     protected function verifyAuth($helper, InputInterface $input, OutputInterface $output)
182 182
     {
183
-        $composerHome = (new Config($output))->getComposerHomeDir();
184
-        $authFile = $composerHome . "/auth.json";
183
+        $composerHome=(new Config($output))->getComposerHomeDir();
184
+        $authFile=$composerHome."/auth.json";
185 185
 
186
-        $authObj = [];
186
+        $authObj=[];
187 187
         if (file_exists($authFile) && is_readable($authFile)) {
188
-            $authJson = file_get_contents($authFile);
189
-            $authObj  = (array)json_decode($authJson, true);
188
+            $authJson=file_get_contents($authFile);
189
+            $authObj=(array) json_decode($authJson, true);
190 190
 
191 191
             if (isset($authObj['http-basic']) && isset($authObj['http-basic']->{'repo.magento.com'})) {
192 192
                 return true;
@@ -195,14 +195,14 @@  discard block
 block discarded – undo
195 195
 
196 196
         $this->askForAuth($helper, $input, $output);
197 197
 
198
-        $authObj['http-basic']['repo.magento.com']['username'] = $this->_m2Username;
199
-        $authObj['http-basic']['repo.magento.com']['password'] = $this->_m2Password;
198
+        $authObj['http-basic']['repo.magento.com']['username']=$this->_m2Username;
199
+        $authObj['http-basic']['repo.magento.com']['password']=$this->_m2Password;
200 200
 
201
-        $authJson = json_encode($authObj, JSON_PRETTY_PRINT);
201
+        $authJson=json_encode($authObj, JSON_PRETTY_PRINT);
202 202
 
203 203
         // check writable first
204 204
         if (!is_writable($authFile)) {
205
-            $e = new AuthSavePermissionsException();
205
+            $e=new AuthSavePermissionsException();
206 206
             throw $e->setAuthObject($authObj);
207 207
         }
208 208
 
@@ -216,13 +216,13 @@  discard block
 block discarded – undo
216 216
      */
217 217
     protected function setPhp($helper, InputInterface $input, OutputInterface $output)
218 218
     {
219
-        $phpVerQuestion = new ChoiceQuestion(
219
+        $phpVerQuestion=new ChoiceQuestion(
220 220
             "Which version of PHP should be installed?",
221 221
             ['56', '70'],
222 222
             0
223 223
         );
224 224
 
225
-        $this->_phpVer = $helper->ask($input, $output, $phpVerQuestion);
225
+        $this->_phpVer=$helper->ask($input, $output, $phpVerQuestion);
226 226
     }
227 227
 
228 228
     /**
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
      */
231 231
     protected function setVagrantBox()
232 232
     {
233
-        $this->_box = self::BOX_PREFIX . $this->_os . "-$this->_server-php$this->_phpVer";
233
+        $this->_box=self::BOX_PREFIX.$this->_os."-$this->_server-php$this->_phpVer";
234 234
     }
235 235
 
236 236
     /**
@@ -253,13 +253,13 @@  discard block
 block discarded – undo
253 253
      */
254 254
     protected function setWebServer($helper, InputInterface $input, OutputInterface $output)
255 255
     {
256
-        $serverQuestion = new ChoiceQuestion(
256
+        $serverQuestion=new ChoiceQuestion(
257 257
             "Which webserver would you like?",
258 258
             ['NGINX', 'Apache'],
259 259
             0
260 260
         );
261 261
 
262
-        $this->_server = strtolower($helper->ask($input, $output, $serverQuestion));
262
+        $this->_server=strtolower($helper->ask($input, $output, $serverQuestion));
263 263
     }
264 264
 
265 265
     /**
@@ -269,12 +269,12 @@  discard block
 block discarded – undo
269 269
      */
270 270
     protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output)
271 271
     {
272
-        $osQuestion = new ChoiceQuestion(
272
+        $osQuestion=new ChoiceQuestion(
273 273
             "Which OS would you like to install?",
274 274
             ['CentOS 6.5', 'Ubuntu 14'],
275 275
             0
276 276
         );
277 277
 
278
-        $this->_os = str_replace(' ', '', str_replace('.', '', strtolower($helper->ask($input, $output, $osQuestion))));
278
+        $this->_os=str_replace(' ', '', str_replace('.', '', strtolower($helper->ask($input, $output, $osQuestion))));
279 279
     }
280 280
 }
Please login to merge, or discard this patch.
src/Magestead/Command/Index/ReindexCommand.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
     protected function configure()
20 20
     {
21
-        $this->_projectPath = getcwd();
21
+        $this->_projectPath=getcwd();
22 22
         $this->setName("index:reindex");
23 23
         $this->setDescription("Reindex data");
24 24
         $this->addArgument('index', InputArgument::OPTIONAL, '[indexer]');
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
     protected function execute(InputInterface $input, OutputInterface $output)
33 33
     {
34 34
         $output->writeln('<info>Reindexing data</info>');
35
-        $index = $input->getArgument('index');
35
+        $index=$input->getArgument('index');
36 36
 
37
-        $command  = $this->getCommand(new Config($output), $index);
38
-        $pCommand = "vagrant ssh -c '". $command ."'";
37
+        $command=$this->getCommand(new Config($output), $index);
38
+        $pCommand="vagrant ssh -c '".$command."'";
39 39
         return new ProcessCommand($pCommand, $this->_projectPath, $output);
40 40
     }
41 41
 
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
      */
47 47
     protected function getCommand(Config $config, $index)
48 48
     {
49
-        $type = $config->type;
49
+        $type=$config->type;
50 50
         switch ($type) {
51 51
             case 'magento':
52
-                $index = (!is_null($index)) ? ' '.$index : ':all';
52
+                $index=(!is_null($index)) ? ' '.$index : ':all';
53 53
                 return "cd /var/www/public;../bin/n98-magerun.phar index:reindex$index";
54 54
             case 'magento2':
55 55
                 return "cd /var/www/public;bin/magento indexer:reindex $index";
Please login to merge, or discard this patch.