Completed
Pull Request — master (#19)
by Rafael Corrêa
03:42
created
src/MageDownload/Command/VersionsCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
             $bits = preg_split('/\-{5,}/', $info);
82 82
             $versions = explode("\n", trim($bits[1]));
83 83
             usort($versions, 'version_compare');
84
-            array_walk($versions, function (&$value) {
84
+            array_walk($versions, function(&$value) {
85 85
                 $value = array($value);
86 86
             });
87 87
             $this->out(array(array(
Please login to merge, or discard this patch.
src/bootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
  * @link      https://github.com/steverobbins/magedownload-cli
13 13
  */
14 14
 
15
-require_once __DIR__ . '/../vendor/autoload.php';
15
+require_once __DIR__.'/../vendor/autoload.php';
16 16
 
17 17
 use MageDownload\Command\Setup;
18 18
 use Symfony\Component\Console\Application;
Please login to merge, or discard this patch.
src/MageDownload/Command/DownloadCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -208,8 +208,8 @@  discard block
 block discarded – undo
208 208
         }
209 209
         if (is_dir($destination)) {
210 210
             unlink($file);
211
-            if (is_dir($mageDir = $destination . DIRECTORY_SEPARATOR . 'magento')) {
212
-                $tmp = 'magedownload_' . microtime(true);
211
+            if (is_dir($mageDir = $destination.DIRECTORY_SEPARATOR.'magento')) {
212
+                $tmp = 'magedownload_'.microtime(true);
213 213
                 exec("mv $mageDir /tmp/$tmp && rm -rf $destination && mv /tmp/$tmp $destination");
214 214
             }
215 215
             return;
@@ -226,13 +226,13 @@  discard block
 block discarded – undo
226 226
     {
227 227
         $dest = $this->input->getArgument(self::ARGUMENT_DESTINATION);
228 228
         if (!$dest) {
229
-            return getcwd() . DIRECTORY_SEPARATOR . $this->input->getArgument(self::ARGUMENT_NAME);
229
+            return getcwd().DIRECTORY_SEPARATOR.$this->input->getArgument(self::ARGUMENT_NAME);
230 230
         }
231 231
         if (is_dir($dest)) {
232 232
             if (substr($dest, -1) !== '/') {
233 233
                 $dest .= DIRECTORY_SEPARATOR;
234 234
             }
235
-            return $dest . $this->input->getArgument(self::ARGUMENT_NAME);
235
+            return $dest.$this->input->getArgument(self::ARGUMENT_NAME);
236 236
         }
237 237
         return $dest;
238 238
     }
Please login to merge, or discard this patch.
src/MageDownload/Command/AbstractCommand.php 1 patch
Spacing   +4 added lines, -6 removed lines patch added patch discarded remove patch
@@ -150,10 +150,10 @@  discard block
 block discarded – undo
150 150
     protected function out($messages = array())
151 151
     {
152 152
         $format = $this->input->getOption('format');
153
-        $method = 'outputFormat' . ucfirst($format);
153
+        $method = 'outputFormat'.ucfirst($format);
154 154
         if (!method_exists($this, $method)) {
155 155
             throw new \InvalidArgumentException(
156
-                'Format "' . $format . '" is not supported'
156
+                'Format "'.$format.'" is not supported'
157 157
             );
158 158
         }
159 159
         $this->$method($messages);
@@ -173,8 +173,7 @@  discard block
 block discarded – undo
173 173
         }
174 174
         foreach ($messages as $message) {
175 175
             switch (isset($message['type']) ? $message['type'] : false) {
176
-                case 'table':
177
-                    $tableHelper = new Table($this->output);
176
+                case 'table' : $tableHelper = new Table($this->output);
178 177
                     $tableHelper
179 178
                         ->setHeaders($message['data'][0])
180 179
                         ->setRows($message['data'][1])
@@ -201,8 +200,7 @@  discard block
 block discarded – undo
201 200
         } else {
202 201
             foreach ($messages as $message) {
203 202
                 switch (isset($message['type']) ? $message['type'] : false) {
204
-                    case 'table':
205
-                        $result = array();
203
+                    case 'table' : $result = array();
206 204
                         $headers = $message['data'][0];
207 205
                         array_map('strtolower', $headers);
208 206
                         foreach ($message['data'][1] as $row) {
Please login to merge, or discard this patch.
src/MageDownload/Command/FilesCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                 self::OPTION_FILTER_TYPE,
68 68
                 null,
69 69
                 InputOption::VALUE_REQUIRED,
70
-                'Type to filter by (' . implode(', ', $this->typeFilters) . ')'
70
+                'Type to filter by ('.implode(', ', $this->typeFilters).')'
71 71
             );
72 72
         parent::configure();
73 73
     }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             $action = self::API_ACTION_FILTER;
90 90
         }
91 91
         return $this->render($info->sendCommand(
92
-            $action . $filters,
92
+            $action.$filters,
93 93
             $this->getAccountId(),
94 94
             $this->getAccessToken(),
95 95
             true
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             $filters['type'] = $this->input->getOption(self::OPTION_FILTER_TYPE);
112 112
             if (!in_array($filters['type'], $this->typeFilters)) {
113 113
                 throw new \InvalidArgumentException(
114
-                    "Invalid filter type.  Must be one of: \n    " . implode("\n    ", $this->typeFilters)
114
+                    "Invalid filter type.  Must be one of: \n    ".implode("\n    ", $this->typeFilters)
115 115
                 );
116 116
             }
117 117
         }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         }
121 121
         $result = '/';
122 122
         foreach ($filters as $type => $value) {
123
-            $result .= $type . '/' . $value;
123
+            $result .= $type.'/'.$value;
124 124
         }
125 125
         return $result;
126 126
     }
Please login to merge, or discard this patch.