Completed
Pull Request — develop (#813)
by Robbie
04:26
created
src/N98/Magento/Command/Database/AbstractShowCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
                 'format',
55 55
                 null,
56 56
                 InputOption::VALUE_OPTIONAL,
57
-                'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
57
+                'Output Format. One of ['.implode(',', RendererFactory::getFormats()).']'
58 58
             )
59 59
             ->addOption(
60 60
                 'rounding',
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
      */
187 187
     protected function formatVariables(array $vars)
188 188
     {
189
-        $rounding = (int) $this->_input->getOption('rounding');
189
+        $rounding = (int)$this->_input->getOption('rounding');
190 190
         if ($rounding > -1) {
191 191
             foreach ($vars as $k => &$v) {
192 192
                 if (true === $this->allowRounding($k)) {
Please login to merge, or discard this patch.
src/N98/Magento/Command/Database/Maintain/CheckTablesCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                 'format',
97 97
                 null,
98 98
                 InputOption::VALUE_OPTIONAL,
99
-                'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
99
+                'Output Format. One of ['.implode(',', RendererFactory::getFormats()).']'
100 100
             )
101 101
             ->setHelp($help);
102 102
     }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
         foreach ($tables as $tableName) {
172 172
             if (isset($allTableStatus[$tableName]) && isset($methods[$allTableStatus[$tableName]['Engine']])) {
173
-                $m = '_check' . $allTableStatus[$tableName]['Engine'];
173
+                $m = '_check'.$allTableStatus[$tableName]['Engine'];
174 174
                 $tableOutput = array_merge($tableOutput, $this->$m($tableName));
175 175
             } else {
176 176
                 $tableOutput[] = array(
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
         return array(
209 209
             array(
210 210
                 'table'     => $tableName,
211
-                'operation' => 'ENGINE ' . $engine,
211
+                'operation' => 'ENGINE '.$engine,
212 212
                 'type'      => sprintf('%15s rows', (string)$affectedRows),
213 213
                 'status'    => sprintf('%.3f secs', microtime(true) - $start),
214 214
             )
Please login to merge, or discard this patch.
src/N98/Magento/Command/Database/ImportCommand.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
     protected function optimize($fileName)
54 54
     {
55 55
         $in = fopen($fileName, 'r');
56
-        $result = tempnam(sys_get_temp_dir(), 'dump') . '.sql';
56
+        $result = tempnam(sys_get_temp_dir(), 'dump').'.sql';
57 57
         $out = fopen($result, 'w');
58 58
 
59
-        fwrite($out, 'SET autocommit=0;' . "\n");
59
+        fwrite($out, 'SET autocommit=0;'."\n");
60 60
         $currentTable = '';
61 61
         $maxlen = 8 * 1024 * 1024; // 8 MB
62 62
         $len = 0;
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
                         fwrite($out, ";\n");
82 82
                     }
83 83
                     $currentTable = $table;
84
-                    $insert = 'INSERT INTO `' . $table . '` VALUES ' . $values;
84
+                    $insert = 'INSERT INTO `'.$table.'` VALUES '.$values;
85 85
                     fwrite($out, $insert);
86 86
                     $len = strlen($insert);
87 87
                 } else {
88
-                    fwrite($out, ',' . $values);
88
+                    fwrite($out, ','.$values);
89 89
                     $len += strlen($values) + 1;
90 90
                 }
91 91
             } else {
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
         fwrite($out, ";\n");
101 101
 
102
-        fwrite($out, 'COMMIT;' . "\n");
102
+        fwrite($out, 'COMMIT;'."\n");
103 103
 
104 104
         fclose($in);
105 105
         fclose($out);
@@ -130,13 +130,13 @@  discard block
 block discarded – undo
130 130
             if ($input->getOption('compression')) {
131 131
                 throw new InvalidArgumentException('Options --compression and --optimize are not compatible');
132 132
             }
133
-            $output->writeln('<comment>Optimizing <info>' . $fileName . '</info> to temporary file');
133
+            $output->writeln('<comment>Optimizing <info>'.$fileName.'</info> to temporary file');
134 134
             $fileName = $this->optimize($fileName);
135 135
         }
136 136
 
137 137
         // create import command
138 138
         $exec = $compressor->getDecompressingCommand(
139
-            'mysql ' . $dbHelper->getMysqlClientToolConnectionString(),
139
+            'mysql '.$dbHelper->getMysqlClientToolConnectionString(),
140 140
             $fileName
141 141
         );
142 142
         if ($input->getOption('only-command')) {
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
     public function asText()
171 171
     {
172
-        return parent::asText() . "\n" .
172
+        return parent::asText()."\n".
173 173
             $this->getCompressionHelp();
174 174
     }
175 175
 
@@ -200,14 +200,14 @@  discard block
 block discarded – undo
200 200
         $returnValue = null;
201 201
         $commandOutput = null;
202 202
         $output->writeln(
203
-            '<comment>Importing SQL dump <info>' . $fileName . '</info> to database <info>'
204
-            . $this->dbSettings['dbname'] . '</info>'
203
+            '<comment>Importing SQL dump <info>'.$fileName.'</info> to database <info>'
204
+            . $this->dbSettings['dbname'].'</info>'
205 205
         );
206 206
 
207 207
         Exec::run($exec, $commandOutput, $returnValue);
208 208
 
209 209
         if ($returnValue <> 0) {
210
-            $output->writeln('<error>' . $commandOutput . '</error>');
210
+            $output->writeln('<error>'.$commandOutput.'</error>');
211 211
         }
212 212
         $output->writeln('<info>Finished</info>');
213 213
     }
Please login to merge, or discard this patch.
src/N98/Magento/Command/Database/QueryCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
             Exec::run($exec, $commandOutput, $returnValue);
79 79
             $output->writeln($commandOutput);
80 80
             if ($returnValue > 0) {
81
-                $output->writeln('<error>' . $commandOutput . '</error>');
81
+                $output->writeln('<error>'.$commandOutput.'</error>');
82 82
             }
83 83
         }
84 84
     }
Please login to merge, or discard this patch.
src/N98/Magento/Command/Database/InfoCommand.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
                 'format',
23 23
                 null,
24 24
                 InputOption::VALUE_OPTIONAL,
25
-                'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
25
+                'Output Format. One of ['.implode(',', RendererFactory::getFormats()).']'
26 26
             )
27 27
         ;
28 28
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
         $settings = array();
48 48
         foreach ($this->dbSettings as $key => $value) {
49
-            $settings[$key] = (string) $value;
49
+            $settings[$key] = (string)$value;
50 50
         }
51 51
 
52 52
         $isSocketConnect = $this->dbSettings->isSocketConnect();
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         }
88 88
         $settings['JDBC-Connection-String'] = $jdbcConnectionString;
89 89
 
90
-        $mysqlCliString = 'mysql ' . $this->getHelper('database')->getMysqlClientToolConnectionString();
90
+        $mysqlCliString = 'mysql '.$this->getHelper('database')->getMysqlClientToolConnectionString();
91 91
         $settings['MySQL-Cli-String'] = $mysqlCliString;
92 92
 
93 93
         $rows = array();
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
 
98 98
         if (($settingArgument = $input->getArgument('setting')) !== null) {
99 99
             if (!isset($settings[$settingArgument])) {
100
-                throw new InvalidArgumentException('Unknown setting: ' . $settingArgument);
100
+                throw new InvalidArgumentException('Unknown setting: '.$settingArgument);
101 101
             }
102
-            $output->writeln((string) $settings[$settingArgument]);
102
+            $output->writeln((string)$settings[$settingArgument]);
103 103
         } else {
104 104
             $this->getHelper('table')
105 105
                 ->setHeaders(array('Name', 'Value'))
Please login to merge, or discard this patch.
src/N98/Magento/Command/Database/Compressor/Uncompressed.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,10 +27,10 @@
 block discarded – undo
27 27
     public function getDecompressingCommand($command, $fileName, $pipe = true)
28 28
     {
29 29
         if ($this->hasPipeViewer()) {
30
-            return 'pv ' . $fileName . ' | ' . $command;
30
+            return 'pv '.$fileName.' | '.$command;
31 31
         }
32 32
 
33
-        return $command . ' < ' . $fileName;
33
+        return $command.' < '.$fileName;
34 34
     }
35 35
 
36 36
     /**
Please login to merge, or discard this patch.
src/N98/Magento/Command/Database/Compressor/Gzip.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@  discard block
 block discarded – undo
14 14
     public function getCompressingCommand($command, $pipe = true)
15 15
     {
16 16
         if ($pipe) {
17
-            return $command . ' | gzip -c ';
17
+            return $command.' | gzip -c ';
18 18
         } else {
19
-            return  'tar -czf ' . $command;
19
+            return  'tar -czf '.$command;
20 20
         }
21 21
     }
22 22
 
@@ -32,16 +32,16 @@  discard block
 block discarded – undo
32 32
     {
33 33
         if ($pipe) {
34 34
             if ($this->hasPipeViewer()) {
35
-                return 'pv -cN gzip ' . escapeshellarg($fileName) . ' | gzip -d | pv -cN mysql | ' . $command;
35
+                return 'pv -cN gzip '.escapeshellarg($fileName).' | gzip -d | pv -cN mysql | '.$command;
36 36
             }
37 37
 
38
-            return 'gzip -dc < ' . escapeshellarg($fileName) . ' | ' . $command;
38
+            return 'gzip -dc < '.escapeshellarg($fileName).' | '.$command;
39 39
         } else {
40 40
             if ($this->hasPipeViewer()) {
41
-                return 'pv -cN tar -zxf ' . escapeshellarg($fileName) . ' && pv -cN mysql | ' . $command;
41
+                return 'pv -cN tar -zxf '.escapeshellarg($fileName).' && pv -cN mysql | '.$command;
42 42
             }
43 43
 
44
-            return 'tar -zxf ' . escapeshellarg($fileName) . ' -C ' . dirname($fileName) . ' && ' . $command . ' < '
44
+            return 'tar -zxf '.escapeshellarg($fileName).' -C '.dirname($fileName).' && '.$command.' < '
45 45
                 . escapeshellarg(substr($fileName, 0, -4));
46 46
         }
47 47
     }
Please login to merge, or discard this patch.
src/N98/Magento/Command/Database/DumpCommand.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
                 'human-readable',
79 79
                 null,
80 80
                 InputOption::VALUE_NONE,
81
-                'Use a single insert with column names per row. Useful to track database differences. Use db:import ' .
81
+                'Use a single insert with column names per row. Useful to track database differences. Use db:import '.
82 82
                 '--optimize for speeding up the import.'
83 83
             )
84 84
             ->addOption(
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
         $list = array();
171 171
         $maxNameLen = 0;
172 172
         foreach ($definitions as $id => $definition) {
173
-            $name = '@' . $id;
174
-            $description = isset($definition['description']) ? $definition['description'] . '.' : '';
173
+            $name = '@'.$id;
174
+            $description = isset($definition['description']) ? $definition['description'].'.' : '';
175 175
             $nameLen = strlen($name);
176 176
             if ($nameLen > $maxNameLen) {
177 177
                 $maxNameLen = $nameLen;
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
             $delta = max(0, $maxNameLen - strlen($name));
187 187
             $spacer = $delta ? str_repeat(' ', $delta) : '';
188 188
             $buffer = wordwrap($description, $decrSize);
189
-            $buffer = strtr($buffer, array("\n" => "\n" . str_repeat(' ', 3 + $maxNameLen)));
189
+            $buffer = strtr($buffer, array("\n" => "\n".str_repeat(' ', 3 + $maxNameLen)));
190 190
             $messages .= sprintf(" <info>%s</info>%s  %s\n", $name, $spacer, $buffer);
191 191
         }
192 192
 
@@ -196,8 +196,8 @@  discard block
 block discarded – undo
196 196
     public function getHelp()
197 197
     {
198 198
         return
199
-            parent::getHelp() . PHP_EOL
200
-            . $this->getCompressionHelp() . PHP_EOL
199
+            parent::getHelp().PHP_EOL
200
+            . $this->getCompressionHelp().PHP_EOL
201 201
             . $this->getTableDefinitionHelp();
202 202
     }
203 203
 
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
                 && !$input->getOption('print-only-filename')
239 239
             ) {
240 240
                 $output->writeln(
241
-                    '<comment>No-data export for: <info>' . implode(' ', $stripTables) . '</info></comment>'
241
+                    '<comment>No-data export for: <info>'.implode(' ', $stripTables).'</info></comment>'
242 242
                 );
243 243
             }
244 244
         }
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
                 && !$input->getOption('print-only-filename')
254 254
             ) {
255 255
                 $output->writeln(
256
-                    '<comment>Excluded: <info>' . implode(' ', $excludeTables) . '</info></comment>'
256
+                    '<comment>Excluded: <info>'.implode(' ', $excludeTables).'</info></comment>'
257 257
                 );
258 258
             }
259 259
         }
@@ -283,29 +283,29 @@  discard block
 block discarded – undo
283 283
 
284 284
         $ignore = '';
285 285
         foreach (array_merge($excludeTables, $stripTables) as $tableName) {
286
-            $ignore .= '--ignore-table=' . $this->dbSettings['dbname'] . '.' . $tableName . ' ';
286
+            $ignore .= '--ignore-table='.$this->dbSettings['dbname'].'.'.$tableName.' ';
287 287
         }
288 288
 
289 289
         $mysqlClientToolConnectionString = $this->getHelper('database')->getMysqlClientToolConnectionString();
290 290
 
291 291
         if (count($stripTables) > 0) {
292 292
             // dump structure for strip-tables
293
-            $exec = 'mysqldump ' . $dumpOptions . '--no-data ' . $mysqlClientToolConnectionString;
294
-            $exec .= ' ' . implode(' ', $stripTables);
293
+            $exec = 'mysqldump '.$dumpOptions.'--no-data '.$mysqlClientToolConnectionString;
294
+            $exec .= ' '.implode(' ', $stripTables);
295 295
             $exec .= $this->postDumpPipeCommands();
296 296
             $exec = $compressor->getCompressingCommand($exec);
297 297
             if (!$input->getOption('stdout')) {
298
-                $exec .= ' > ' . escapeshellarg($fileName);
298
+                $exec .= ' > '.escapeshellarg($fileName);
299 299
             }
300 300
             $execs[] = $exec;
301 301
         }
302 302
 
303 303
         // dump data for all other tables
304
-        $exec = 'mysqldump ' . $dumpOptions . $mysqlClientToolConnectionString . ' ' . $ignore;
304
+        $exec = 'mysqldump '.$dumpOptions.$mysqlClientToolConnectionString.' '.$ignore;
305 305
         $exec .= $this->postDumpPipeCommands();
306 306
         $exec = $compressor->getCompressingCommand($exec);
307 307
         if (!$input->getOption('stdout')) {
308
-            $exec .= (count($stripTables) > 0 ? ' >> ' : ' > ') . escapeshellarg($fileName);
308
+            $exec .= (count($stripTables) > 0 ? ' >> ' : ' > ').escapeshellarg($fileName);
309 309
         }
310 310
         $execs[] = $exec;
311 311
 
@@ -329,8 +329,8 @@  discard block
 block discarded – undo
329 329
                 && !$input->getOption('print-only-filename')
330 330
             ) {
331 331
                 $output->writeln(
332
-                    '<comment>Start dumping database <info>' . $this->dbSettings['dbname']
333
-                    . '</info> to file <info>' . $fileName . '</info>'
332
+                    '<comment>Start dumping database <info>'.$this->dbSettings['dbname']
333
+                    . '</info> to file <info>'.$fileName.'</info>'
334 334
                 );
335 335
             }
336 336
 
@@ -346,8 +346,8 @@  discard block
 block discarded – undo
346 346
                     Exec::run($exec, $commandOutput, $returnValue);
347 347
                 }
348 348
                 if ($returnValue > 0) {
349
-                    $output->writeln('<error>' . $commandOutput . '</error>');
350
-                    $output->writeln('<error>Return Code: ' . $returnValue . '. ABORTED.</error>');
349
+                    $output->writeln('<error>'.$commandOutput.'</error>');
350
+                    $output->writeln('<error>Return Code: '.$returnValue.'. ABORTED.</error>');
351 351
 
352 352
                     return;
353 353
                 }
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
      */
371 371
     protected function postDumpPipeCommands()
372 372
     {
373
-        return ' | LANG=C LC_CTYPE=C LC_ALL=C sed -e ' . escapeshellarg('s/DEFINER[ ]*=[ ]*[^*]*\*/\*/');
373
+        return ' | LANG=C LC_CTYPE=C LC_ALL=C sed -e '.escapeshellarg('s/DEFINER[ ]*=[ ]*[^*]*\*/\*/');
374 374
     }
375 375
 
376 376
     /**
@@ -395,9 +395,9 @@  discard block
 block discarded – undo
395 395
             $timeStamp = date('Y-m-d_His');
396 396
 
397 397
             if ($input->getOption('add-time') == 'suffix') {
398
-                $nameSuffix = '_' . $timeStamp;
398
+                $nameSuffix = '_'.$timeStamp;
399 399
             } else {
400
-                $namePrefix = $timeStamp . '_';
400
+                $namePrefix = $timeStamp.'_';
401 401
             }
402 402
         }
403 403
 
@@ -411,15 +411,15 @@  discard block
 block discarded – undo
411 411
             /** @var DialogHelper $dialog */
412 412
             $dialog = $this->getHelperSet()->get('dialog');
413 413
             $defaultName = VerifyOrDie::filename(
414
-                $namePrefix . $this->dbSettings['dbname'] . $nameSuffix . $nameExtension
414
+                $namePrefix.$this->dbSettings['dbname'].$nameSuffix.$nameExtension
415 415
             );
416 416
             if (isset($isDir) && $isDir) {
417
-                $defaultName = rtrim($fileName, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $defaultName;
417
+                $defaultName = rtrim($fileName, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$defaultName;
418 418
             }
419 419
             if (!$input->getOption('force')) {
420 420
                 $fileName = $dialog->ask(
421 421
                     $output,
422
-                    '<question>Filename for SQL dump:</question> [<comment>' . $defaultName . '</comment>]',
422
+                    '<question>Filename for SQL dump:</question> [<comment>'.$defaultName.'</comment>]',
423 423
                     $defaultName
424 424
                 );
425 425
             } else {
@@ -428,8 +428,8 @@  discard block
 block discarded – undo
428 428
         } else {
429 429
             if ($input->getOption('add-time')) {
430 430
                 $pathParts = pathinfo($fileName);
431
-                $fileName = ($pathParts['dirname'] == '.' ? '' : $pathParts['dirname'] . DIRECTORY_SEPARATOR) .
432
-                    $namePrefix . $pathParts['filename'] . $nameSuffix . '.' . $pathParts['extension'];
431
+                $fileName = ($pathParts['dirname'] == '.' ? '' : $pathParts['dirname'].DIRECTORY_SEPARATOR).
432
+                    $namePrefix.$pathParts['filename'].$nameSuffix.'.'.$pathParts['extension'];
433 433
             }
434 434
         }
435 435
 
Please login to merge, or discard this patch.
src/N98/Magento/Command/Admin/User/ChangeStatusCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,17 +70,17 @@
 block discarded – undo
70 70
 
71 71
                 if ($user->getIsActive() == 1) {
72 72
                     $output->writeln(
73
-                        '<info>User <comment>' . $user->getUsername() . '</comment>' .
73
+                        '<info>User <comment>'.$user->getUsername().'</comment>'.
74 74
                         ' is now <comment>active</comment></info>'
75 75
                     );
76 76
                 } else {
77 77
                     $output->writeln(
78
-                        '<info>User <comment>' . $user->getUsername() . '</comment>' .
78
+                        '<info>User <comment>'.$user->getUsername().'</comment>'.
79 79
                         ' is now <comment>inactive</comment></info>'
80 80
                     );
81 81
                 }
82 82
             } catch (Exception $e) {
83
-                $output->writeln('<error>' . $e->getMessage() . '</error>');
83
+                $output->writeln('<error>'.$e->getMessage().'</error>');
84 84
             }
85 85
         }
86 86
     }
Please login to merge, or discard this patch.