Completed
Pull Request — develop (#813)
by Robbie
08:16 queued 03:39
created
N98/Magento/Command/Developer/Setup/Script/Attribute/EntityType/Factory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     public static function create($entityType, $attribute)
16 16
     {
17 17
         $words = explode('_', strtolower($entityType));
18
-        $class = __NAMESPACE__ . '\\';
18
+        $class = __NAMESPACE__.'\\';
19 19
         foreach ($words as $word) {
20 20
             $class .= ucfirst(trim($word));
21 21
         }
Please login to merge, or discard this patch.
src/N98/Magento/Command/Developer/ClassLookupCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@
 block discarded – undo
42 42
                 $input->getArgument('name')
43 43
             );
44 44
             $output->writeln(
45
-                ucfirst($input->getArgument('type')) . ' <comment>' . $input->getArgument('name') . "</comment> " .
46
-                "resolves to <comment>" . $resolved . '</comment>'
45
+                ucfirst($input->getArgument('type')).' <comment>'.$input->getArgument('name')."</comment> ".
46
+                "resolves to <comment>".$resolved.'</comment>'
47 47
             );
48 48
             
49
-            if (!class_exists('\\' . $resolved)) {
50
-                $output->writeln('<info>Note:</info> Class <comment>' . $resolved . '</comment> does not exist!');
49
+            if (!class_exists('\\'.$resolved)) {
50
+                $output->writeln('<info>Note:</info> Class <comment>'.$resolved.'</comment> does not exist!');
51 51
             }
52 52
         }
53 53
     }
Please login to merge, or discard this patch.
src/N98/Magento/Command/Developer/Code/Model/MethodCommand.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             ->setName('dev:code:model:method')
49 49
             ->addArgument('modelName', InputOption::VALUE_REQUIRED, 'Model Name namespace/modelName')
50 50
             ->setDescription(
51
-                'Code annotations: Reads the columns from a table and writes the getter and setter methods into the ' .
51
+                'Code annotations: Reads the columns from a table and writes the getter and setter methods into the '.
52 52
                 'class file for @methods.'
53 53
             );
54 54
     }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $this->checkClassFileName();
73 73
         $this->initTableColumns();
74 74
         $this->writeToClassFile();
75
-        $this->_output->writeln("Wrote getter and setter @methods into file: " . $this->_fileName);
75
+        $this->_output->writeln("Wrote getter and setter @methods into file: ".$this->_fileName);
76 76
     }
77 77
 
78 78
     protected function writeToClassFile()
@@ -81,13 +81,13 @@  discard block
 block discarded – undo
81 81
         $fileParts = preg_split('~(\s+)(class)(\s+)([a-z0-9_]+)~i', $modelFileContent, -1, PREG_SPLIT_DELIM_CAPTURE);
82 82
         foreach ($fileParts as $index => $part) {
83 83
             if (strtolower($part) === 'class') {
84
-                $fileParts[$index] = $this->generateComment() . $part;
84
+                $fileParts[$index] = $this->generateComment().$part;
85 85
                 break;
86 86
             }
87 87
         }
88 88
         $written = file_put_contents($this->_fileName, implode('', $fileParts));
89 89
         if (false === $written) {
90
-            throw new RuntimeException("Cannot write to file: " . $this->_fileName);
90
+            throw new RuntimeException("Cannot write to file: ".$this->_fileName);
91 91
         }
92 92
     }
93 93
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      */
97 97
     protected function generateComment()
98 98
     {
99
-        return PHP_EOL . '/**' . PHP_EOL . implode(PHP_EOL, $this->getGetterSetter()) . PHP_EOL . ' */' . PHP_EOL;
99
+        return PHP_EOL.'/**'.PHP_EOL.implode(PHP_EOL, $this->getGetterSetter()).PHP_EOL.' */'.PHP_EOL;
100 100
     }
101 101
 
102 102
     /**
@@ -170,12 +170,12 @@  discard block
 block discarded – undo
170 170
         /* @var $dbHelper \N98\Util\Console\Helper\DatabaseHelper */
171 171
         /** @var \PDO $connection */
172 172
         $connection = $dbHelper->getConnection($this->_output);
173
-        $stmt = $connection->query('SHOW COLUMNS FROM ' . $this->_mageModelTable, \PDO::FETCH_ASSOC);
173
+        $stmt = $connection->query('SHOW COLUMNS FROM '.$this->_mageModelTable, \PDO::FETCH_ASSOC);
174 174
         foreach ($stmt as $row) {
175 175
             $this->_tableColumns[$row['Field']] = $row;
176 176
         }
177 177
         if (0 === count($this->_tableColumns)) {
178
-            throw new InvalidArgumentException('No columns found in table: ' . $this->_mageModelTable);
178
+            throw new InvalidArgumentException('No columns found in table: '.$this->_mageModelTable);
179 179
         }
180 180
     }
181 181
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
     {
189 189
         $paths = explode(PATH_SEPARATOR, get_include_path());
190 190
         foreach ($paths as $path) {
191
-            $fullPath = $path . DIRECTORY_SEPARATOR . $filename;
191
+            $fullPath = $path.DIRECTORY_SEPARATOR.$filename;
192 192
             if (true === @file_exists($fullPath)) {
193 193
                 return $fullPath;
194 194
             }
@@ -203,11 +203,11 @@  discard block
 block discarded – undo
203 203
             ' ',
204 204
             DIRECTORY_SEPARATOR,
205 205
             ucwords(str_replace('_', ' ', get_class($this->_mageModel)))
206
-        ) . '.php';
206
+        ).'.php';
207 207
         $this->_fileName = $this->searchFullPath($fileName);
208 208
 
209 209
         if (false === $this->_fileName) {
210
-            throw new InvalidArgumentException('File not found: ' . $this->_fileName);
210
+            throw new InvalidArgumentException('File not found: '.$this->_fileName);
211 211
         }
212 212
     }
213 213
 
@@ -215,14 +215,14 @@  discard block
 block discarded – undo
215 215
     {
216 216
         $this->_mageModel = \Mage::getModel($this->_input->getArgument('modelName'));
217 217
         if (true === empty($this->_mageModel)) {
218
-            throw new InvalidArgumentException('Model ' . $this->_input->getArgument('modelName') . ' not found!');
218
+            throw new InvalidArgumentException('Model '.$this->_input->getArgument('modelName').' not found!');
219 219
         }
220 220
 
221 221
         $this->_mageModelTable = $this->_mageModel->getResource()
222 222
             ? $this->_mageModel->getResource()->getMainTable() : null;
223 223
         if (true === empty($this->_mageModelTable)) {
224 224
             throw new InvalidArgumentException(
225
-                'Cannot find main table of model ' . $this->_input->getArgument('modelName')
225
+                'Cannot find main table of model '.$this->_input->getArgument('modelName')
226 226
             );
227 227
         }
228 228
     }
Please login to merge, or discard this patch.
src/N98/Magento/Command/Indexer/ReindexAllCommand.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
                 $indexCollection = $this->_getIndexerModel()->getProcessesCollection();
36 36
                 foreach ($indexCollection as $indexer) {
37 37
                     $output->writeln(
38
-                        '<info>Started reindex of: <comment>' . $indexer->getIndexerCode() . '</comment></info>'
38
+                        '<info>Started reindex of: <comment>'.$indexer->getIndexerCode().'</comment></info>'
39 39
                     );
40 40
                     /**
41 41
                      * Try to estimate runtime. If index was aborted or never created we have a timestamp < 0
@@ -43,23 +43,23 @@  discard block
 block discarded – undo
43 43
                     $runtimeInSeconds = $this->getRuntimeInSeconds($indexer);
44 44
                     if ($runtimeInSeconds > 0) {
45 45
                         $estimatedEnd = new \DateTime('now', new \DateTimeZone('UTC'));
46
-                        $estimatedEnd->add(new \DateInterval('PT' . $runtimeInSeconds . 'S'));
46
+                        $estimatedEnd->add(new \DateInterval('PT'.$runtimeInSeconds.'S'));
47 47
                         $output->writeln(
48
-                            '<info>Estimated end: <comment>' . $estimatedEnd->format('Y-m-d H:i:s T') .
48
+                            '<info>Estimated end: <comment>'.$estimatedEnd->format('Y-m-d H:i:s T').
49 49
                             '</comment></info>'
50 50
                         );
51 51
                     }
52 52
                     $startTime = new \DateTime('now');
53 53
                     $dateTimeUtils = new \N98\Util\DateTime();
54 54
                     $indexer->reindexEverything();
55
-                    \Mage::dispatchEvent($indexer->getIndexerCode() . '_shell_reindex_after');
55
+                    \Mage::dispatchEvent($indexer->getIndexerCode().'_shell_reindex_after');
56 56
                     $endTime = new \DateTime('now');
57 57
                     $output->writeln(
58
-                        '<info>Successfully reindexed <comment>' . $indexer->getIndexerCode() .
59
-                        '</comment> (Runtime: <comment>' . $dateTimeUtils->getDifferenceAsString(
58
+                        '<info>Successfully reindexed <comment>'.$indexer->getIndexerCode().
59
+                        '</comment> (Runtime: <comment>'.$dateTimeUtils->getDifferenceAsString(
60 60
                             $startTime,
61 61
                             $endTime
62
-                        ) . '</comment>)</info>'
62
+                        ).'</comment>)</info>'
63 63
                     );
64 64
                 }
65 65
                 \Mage::dispatchEvent('shell_reindex_init_process');
Please login to merge, or discard this patch.
src/N98/Magento/Command/Indexer/ReindexCommand.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
             if ($indexCode === null) {
54 54
                 $question = array();
55 55
                 foreach ($indexerList as $key => $indexer) {
56
-                    $question[] = '<comment>' . str_pad('[' . ($key + 1) . ']', 4, ' ', STR_PAD_RIGHT) . '</comment> ' .
57
-                        str_pad($indexer['code'], 40, ' ', STR_PAD_RIGHT) . ' <info>(last runtime: ' .
58
-                        $indexer['last_runtime'] . ')</info>' . "\n";
56
+                    $question[] = '<comment>'.str_pad('['.($key + 1).']', 4, ' ', STR_PAD_RIGHT).'</comment> '.
57
+                        str_pad($indexer['code'], 40, ' ', STR_PAD_RIGHT).' <info>(last runtime: '.
58
+                        $indexer['last_runtime'].')</info>'."\n";
59 59
                 }
60 60
                 $question[] = '<question>Please select a indexer:</question>';
61 61
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
                     if (!$process) {
92 92
                         throw new InvalidArgumentException('Indexer was not found!');
93 93
                     }
94
-                    $output->writeln('<info>Started reindex of: <comment>' . $indexCode . '</comment></info>');
94
+                    $output->writeln('<info>Started reindex of: <comment>'.$indexCode.'</comment></info>');
95 95
 
96 96
                     /**
97 97
                      * Try to estimate runtime. If index was aborted or never created we have a timestamp < 0
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
                     $runtimeInSeconds = $this->getRuntimeInSeconds($process);
100 100
                     if ($runtimeInSeconds > 0) {
101 101
                         $estimatedEnd = new \DateTime('now', new \DateTimeZone('UTC'));
102
-                        $estimatedEnd->add(new \DateInterval('PT' . $runtimeInSeconds . 'S'));
102
+                        $estimatedEnd->add(new \DateInterval('PT'.$runtimeInSeconds.'S'));
103 103
                         $output->writeln(
104
-                            '<info>Estimated end: <comment>' . $estimatedEnd->format('Y-m-d H:i:s T') .
104
+                            '<info>Estimated end: <comment>'.$estimatedEnd->format('Y-m-d H:i:s T').
105 105
                             '</comment></info>'
106 106
                         );
107 107
                     }
@@ -109,18 +109,18 @@  discard block
 block discarded – undo
109 109
                     $startTime = new \DateTime('now');
110 110
                     $dateTimeUtils = new \N98\Util\DateTime();
111 111
                     $process->reindexEverything();
112
-                    \Mage::dispatchEvent($process->getIndexerCode() . '_shell_reindex_after');
112
+                    \Mage::dispatchEvent($process->getIndexerCode().'_shell_reindex_after');
113 113
                     $endTime = new \DateTime('now');
114 114
                     $output->writeln(
115
-                        '<info>Successfully reindexed <comment>' . $indexCode . '</comment> (Runtime: <comment>' .
115
+                        '<info>Successfully reindexed <comment>'.$indexCode.'</comment> (Runtime: <comment>'.
116 116
                         $dateTimeUtils->getDifferenceAsString(
117 117
                             $startTime,
118 118
                             $endTime
119
-                        ) . '</comment>)</info>'
119
+                        ).'</comment>)</info>'
120 120
                     );
121 121
                     \Mage::dispatchEvent('shell_reindex_finalize_process');
122 122
                 } catch (Exception $e) {
123
-                    $output->writeln('<error>' . $e->getMessage() . '</error>');
123
+                    $output->writeln('<error>'.$e->getMessage().'</error>');
124 124
                     \Mage::dispatchEvent('shell_reindex_finalize_process');
125 125
                 }
126 126
             }
Please login to merge, or discard this patch.
src/N98/Magento/Command/MagentoConnect/DownloadExtensionCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,6 +29,6 @@
 block discarded – undo
29 29
      */
30 30
     protected function doAction(InputInterface $input, OutputInterface $output, $package)
31 31
     {
32
-        $output->writeln($this->callMageScript($input, $output, 'download community ' . $package));
32
+        $output->writeln($this->callMageScript($input, $output, 'download community '.$package));
33 33
     }
34 34
 }
Please login to merge, or discard this patch.
src/N98/Magento/Command/MagentoConnect/ListExtensionsCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
                 'format',
22 22
                 null,
23 23
                 InputOption::VALUE_OPTIONAL,
24
-                'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
24
+                'Output Format. One of ['.implode(',', RendererFactory::getFormats()).']'
25 25
             )
26 26
         ;
27 27
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         if (!strstr($extensions, 'Please initialize Magento Connect installer')) {
45 45
             $searchString = $input->getArgument('search');
46 46
             $table = array();
47
-            foreach (preg_split('/' . PHP_EOL . '/', $extensions) as $line) {
47
+            foreach (preg_split('/'.PHP_EOL.'/', $extensions) as $line) {
48 48
                 if (strpos($line, ':') > 0) {
49 49
                     $matches = null;
50 50
                     if ($matches = $this->matchConnectLine($line)) {
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
                     ->renderByFormat($output, $table, $input->getOption('format'));
81 81
             }
82 82
         } else {
83
-            $output->writeln('<error>' . $extensions . '</error>');
83
+            $output->writeln('<error>'.$extensions.'</error>');
84 84
         }
85 85
     }
86 86
 }
Please login to merge, or discard this patch.
src/N98/Magento/Command/MagentoConnect/UpgradeExtensionCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,6 +29,6 @@
 block discarded – undo
29 29
      */
30 30
     protected function doAction(InputInterface $input, OutputInterface $output, $package)
31 31
     {
32
-        $output->writeln($this->callMageScript($input, $output, 'upgrade community ' . $package));
32
+        $output->writeln($this->callMageScript($input, $output, 'upgrade community '.$package));
33 33
     }
34 34
 }
Please login to merge, or discard this patch.
src/N98/Magento/Command/MagentoConnect/ValidateExtensionCommand.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             $return = array();
132 132
             foreach ($files as $file) {
133 133
                 $path = $this->_getPathOfFileNodeToTarget($file);
134
-                $return[$path] = (string) $file['hash'];
134
+                $return[$path] = (string)$file['hash'];
135 135
             }
136 136
         }
137 137
 
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
     protected function _getPathOfFileNodeToTarget(SimpleXMLElement $node, $path = '')
172 172
     {
173 173
         if ($node->getName() == 'target') {
174
-            return $this->_getBasePathFromTargetName((string) $node['name']) . $path;
174
+            return $this->_getBasePathFromTargetName((string)$node['name']).$path;
175 175
         }
176 176
 
177
-        $path   = '/' . $node['name'] . $path;
177
+        $path   = '/'.$node['name'].$path;
178 178
         $parent = $this->_getParentNode($node);
179 179
 
180 180
         return $this->_getPathOfFileNodeToTarget($parent, $path);
@@ -199,10 +199,10 @@  discard block
 block discarded – undo
199 199
     protected function getPathOfFileNodeToTarget($node, $path = '')
200 200
     {
201 201
         if ($node->getName() == 'target') {
202
-            return $this->_getBasePathFromTargetName((string) $node['name']) . $path;
202
+            return $this->_getBasePathFromTargetName((string)$node['name']).$path;
203 203
         }
204 204
 
205
-        $path = '/' . $node['name'] . $path;
205
+        $path = '/'.$node['name'].$path;
206 206
         $parent = $this->_getParentNode($node);
207 207
         return $this->_getPathOfFileNodeToTarget($parent, $path);
208 208
     }
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
 
223 223
         $pathBase = \Mage::getBaseDir();
224 224
         foreach ($files as $path => $hash) {
225
-            $path = $pathBase . \DS . $path;
226
-            $this->_optionOutput('Checking: ' . $path, 'full-report', $output, $input);
225
+            $path = $pathBase.\DS.$path;
226
+            $this->_optionOutput('Checking: '.$path, 'full-report', $output, $input);
227 227
 
228 228
             if (file_exists($path)) {
229 229
                 $this->_optionOutput('    Path: OK', array('full-report', 'file'), $output, $input);
@@ -231,11 +231,11 @@  discard block
 block discarded – undo
231 231
                 if (md5(file_get_contents($path)) == $hash) {
232 232
                     $this->_optionOutput('    Hash: OK', array('full-report', 'hash'), $output, $input);
233 233
                 } else {
234
-                    $this->_optionOutput('Problem: ' . $path, 'hash', $output, $input);
234
+                    $this->_optionOutput('Problem: '.$path, 'hash', $output, $input);
235 235
                     $this->_optionOutput('    Hash: MISMATCH', 'hash', $output, $input);
236 236
                 }
237 237
             } else {
238
-                $this->_optionOutput('Problem: ' . $path, 'file', $output, $input);
238
+                $this->_optionOutput('Problem: '.$path, 'file', $output, $input);
239 239
                 $this->_optionOutput('    Path: FILE NOT FOUND', 'file', $output, $input);
240 240
             }
241 241
         }
@@ -360,6 +360,6 @@  discard block
 block discarded – undo
360 360
      */
361 361
     protected function _getDownloaderConfigPath()
362 362
     {
363
-        return \Mage::getBaseDir() . '/downloader/cache.cfg';
363
+        return \Mage::getBaseDir().'/downloader/cache.cfg';
364 364
     }
365 365
 }
Please login to merge, or discard this patch.