Passed
Push — master ( f73d2a...b6f14a )
by f
14:52
created
src/Drivers/TarByPear.php 1 patch
Braces   +29 added lines, -19 removed lines patch added patch discarded remove patch
@@ -57,7 +57,9 @@  discard block
 block discarded – undo
57 57
     public static function checkFormatSupport($format)
58 58
     {
59 59
         $availability = class_exists('\Archive_Tar');
60
-        if (!$availability) return false;
60
+        if (!$availability) {
61
+         return false;
62
+        }
61 63
         switch ($format) {
62 64
             case Formats::TAR:
63 65
                 return true;
@@ -140,10 +142,11 @@  discard block
 block discarded – undo
140 142
                 break;
141 143
         }
142 144
 
143
-        if (isset($tar_aname))
144
-            $tar = new Archive_Tar($tar_aname, $compression);
145
-        else
146
-            $tar = new Archive_Tar($archiveFileName, $compression);
145
+        if (isset($tar_aname)) {
146
+                    $tar = new Archive_Tar($tar_aname, $compression);
147
+        } else {
148
+                    $tar = new Archive_Tar($archiveFileName, $compression);
149
+        }
147 150
 
148 151
         $current_file = 0;
149 152
         $total_files = count($files);
@@ -152,11 +155,13 @@  discard block
 block discarded – undo
152 155
             $add_dir = dirname($localName);
153 156
 
154 157
             if (is_null($filename)) {
155
-                if ($tar->addString($localName, '') === false)
156
-                    throw new ArchiveCreationException('Error when adding directory '.$localName.' to archive');
158
+                if ($tar->addString($localName, '') === false) {
159
+                                    throw new ArchiveCreationException('Error when adding directory '.$localName.' to archive');
160
+                }
157 161
             } else {
158
-                if ($tar->addModify($filename, $add_dir, $remove_dir) === false)
159
-                    throw new ArchiveCreationException('Error when adding file '.$filename.' to archive');
162
+                if ($tar->addModify($filename, $add_dir, $remove_dir) === false) {
163
+                                    throw new ArchiveCreationException('Error when adding file '.$filename.' to archive');
164
+                }
160 165
             }
161 166
             if ($fileProgressCallable !== null) {
162 167
                 call_user_func_array($fileProgressCallable, [$current_file++, $total_files, $filename, $localName]);
@@ -216,8 +221,9 @@  discard block
 block discarded – undo
216 221
                 continue;
217 222
             }
218 223
             // skip directories
219
-            if ($file['typeflag'] == '5' || substr($file['filename'], -1) === '/')
220
-                continue;
224
+            if ($file['typeflag'] == '5' || substr($file['filename'], -1) === '/') {
225
+                            continue;
226
+            }
221 227
             $information->files[] = $file['filename'];
222 228
             $information->uncompressedFilesSize += $file['size'];
223 229
             $this->pearFilesIndex[$file['filename']] = $i;
@@ -262,14 +268,16 @@  discard block
 block discarded – undo
262 268
      */
263 269
     public function getFileData($fileName)
264 270
     {
265
-        if (!isset($this->pearFilesIndex[$fileName]))
266
-            throw new NonExistentArchiveFileException('File '.$fileName.' is not found in archive files list');
271
+        if (!isset($this->pearFilesIndex[$fileName])) {
272
+                    throw new NonExistentArchiveFileException('File '.$fileName.' is not found in archive files list');
273
+        }
267 274
 
268 275
         $index = $this->pearFilesIndex[$fileName];
269 276
 
270 277
         $files_list = $this->tar->listContent();
271
-        if (!isset($files_list[$index]))
272
-            throw new NonExistentArchiveFileException('File '.$fileName.' is not found in Tar archive');
278
+        if (!isset($files_list[$index])) {
279
+                    throw new NonExistentArchiveFileException('File '.$fileName.' is not found in Tar archive');
280
+        }
273 281
 
274 282
         $data = $files_list[$index];
275 283
         unset($files_list);
@@ -284,8 +292,9 @@  discard block
 block discarded – undo
284 292
      */
285 293
     public function getFileContent($fileName)
286 294
     {
287
-        if (!isset($this->pearFilesIndex[$fileName]))
288
-            throw new NonExistentArchiveFileException('File '.$fileName.' is not found in archive files list');
295
+        if (!isset($this->pearFilesIndex[$fileName])) {
296
+                    throw new NonExistentArchiveFileException('File '.$fileName.' is not found in archive files list');
297
+        }
289 298
 
290 299
         return $this->tar->extractInString($fileName);
291 300
     }
@@ -295,8 +304,9 @@  discard block
 block discarded – undo
295 304
      */
296 305
     public function getFileStream($fileName)
297 306
     {
298
-        if (!isset($this->pearFilesIndex[$fileName]))
299
-            throw new NonExistentArchiveFileException('File '.$fileName.' is not found in archive files list');
307
+        if (!isset($this->pearFilesIndex[$fileName])) {
308
+                    throw new NonExistentArchiveFileException('File '.$fileName.' is not found in archive files list');
309
+        }
300 310
 
301 311
         return self::wrapStringInStream($this->tar->extractInString($fileName));
302 312
     }
Please login to merge, or discard this patch.
src/Drivers/SevenZip.php 1 patch
Braces   +30 added lines, -20 removed lines patch added patch discarded remove patch
@@ -58,12 +58,14 @@  discard block
 block discarded – undo
58 58
     public static function checkFormatSupport($format)
59 59
     {
60 60
         $available = class_exists('\Archive7z\Archive7z') && Archive7z::getBinaryVersion() !== false;
61
-        if (!$available)
62
-            return false;
61
+        if (!$available) {
62
+                    return false;
63
+        }
63 64
 
64 65
         // in 4.0.0 version it was supporting only 7z
65
-        if (!Archive7z::supportsAllFormats())
66
-            return $format === Formats::SEVEN_ZIP;
66
+        if (!Archive7z::supportsAllFormats()) {
67
+                    return $format === Formats::SEVEN_ZIP;
68
+        }
67 69
 
68 70
         switch ($format) {
69 71
             case Formats::SEVEN_ZIP:
@@ -104,11 +106,13 @@  discard block
 block discarded – undo
104 106
      */
105 107
     public static function getInstallationInstruction()
106 108
     {
107
-        if (!class_exists('\Archive7z\Archive7z'))
108
-            return 'install library `gemorroj/archive7z` and console program p7zip (7za)';
109
+        if (!class_exists('\Archive7z\Archive7z')) {
110
+                    return 'install library `gemorroj/archive7z` and console program p7zip (7za)';
111
+        }
109 112
 
110
-        if (Archive7z::getBinaryVersion() === false)
111
-            return 'install console program p7zip (7za)';
113
+        if (Archive7z::getBinaryVersion() === false) {
114
+                    return 'install console program p7zip (7za)';
115
+        }
112 116
 
113 117
         return null;
114 118
     }
@@ -121,8 +125,9 @@  discard block
 block discarded – undo
121 125
         try {
122 126
             $this->format = $format;
123 127
             $this->sevenZip = new Archive7z($archiveFileName, null, null);
124
-            if ($password !== null)
125
-                $this->sevenZip->setPassword($password);
128
+            if ($password !== null) {
129
+                            $this->sevenZip->setPassword($password);
130
+            }
126 131
         } catch (\Archive7z\Exception $e) {
127 132
             throw new Exception('Could not open 7Zip archive: '.$e->getMessage(), $e->getCode(), $e);
128 133
         }
@@ -140,8 +145,9 @@  discard block
 block discarded – undo
140 145
                 continue;
141 146
             }
142 147
 
143
-            if (!isset($can_get_unix_path))
144
-                $can_get_unix_path = method_exists($entry, 'getUnixPath');
148
+            if (!isset($can_get_unix_path)) {
149
+                            $can_get_unix_path = method_exists($entry, 'getUnixPath');
150
+            }
145 151
 
146 152
             $information->files[] = $can_get_unix_path
147 153
                 ? $entry->getUnixPath()
@@ -159,8 +165,9 @@  discard block
 block discarded – undo
159 165
     {
160 166
         $files = [];
161 167
         foreach ($this->sevenZip->getEntries() as $entry) {
162
-            if ($entry->isDirectory())
163
-                continue;
168
+            if ($entry->isDirectory()) {
169
+                            continue;
170
+            }
164 171
             $files[] = $entry->getPath();
165 172
         }
166 173
         return $files;
@@ -301,8 +308,9 @@  discard block
 block discarded – undo
301 308
     public function addFileFromString($inArchiveName, $content)
302 309
     {
303 310
         $tmp_file = tempnam(sys_get_temp_dir(), 'ua');
304
-        if (!$tmp_file)
305
-            throw new ArchiveModificationException('Could not create temporarily file');
311
+        if (!$tmp_file) {
312
+                    throw new ArchiveModificationException('Could not create temporarily file');
313
+        }
306 314
 
307 315
         file_put_contents($tmp_file, $content);
308 316
         $this->sevenZip->addEntry($tmp_file, true);
@@ -352,8 +360,9 @@  discard block
 block discarded – undo
352 360
             $total_files = count($files);
353 361
 
354 362
             $seven_zip = new Archive7z($archiveFileName);
355
-            if ($password !== null)
356
-                $seven_zip->setPassword($password);
363
+            if ($password !== null) {
364
+                            $seven_zip->setPassword($password);
365
+            }
357 366
             $seven_zip->setCompressionLevel($compressionLevelMap[$compressionLevel]);
358 367
             foreach ($files as $localName => $filename) {
359 368
                 if ($filename !== null) {
@@ -385,8 +394,9 @@  discard block
 block discarded – undo
385 394
             Formats::TAR,
386 395
             Formats::LZMA,
387 396
             Formats::ZIP]
388
-        ))
389
-            return self::canRenameFiles();
397
+        )) {
398
+                    return self::canRenameFiles();
399
+        }
390 400
 
391 401
         return false;
392 402
     }
Please login to merge, or discard this patch.
src/Drivers/OneFile/OneFileDriver.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,10 +24,12 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function __construct($archiveFileName, $format, $password = null)
26 26
     {
27
-        if (static::FORMAT_SUFFIX === null)
28
-            throw new \Exception('Format should be initialized');
29
-        if ($password !== null)
30
-            throw new UnsupportedOperationException(self::FORMAT_SUFFIX.' archive does not support password!');
27
+        if (static::FORMAT_SUFFIX === null) {
28
+                    throw new \Exception('Format should be initialized');
29
+        }
30
+        if ($password !== null) {
31
+                    throw new UnsupportedOperationException(self::FORMAT_SUFFIX.' archive does not support password!');
32
+        }
31 33
 
32 34
         $this->fileName = $archiveFileName;
33 35
         $this->inArchiveFileName = basename($archiveFileName, '.'.static::FORMAT_SUFFIX);
@@ -95,8 +97,9 @@  discard block
 block discarded – undo
95 97
     public function extractArchive($outputFolder)
96 98
     {
97 99
         $data = $this->getFileContent($this->inArchiveFileName);
98
-        if ($data === false)
99
-            throw new ArchiveExtractionException('Could not extract archive');
100
+        if ($data === false) {
101
+                    throw new ArchiveExtractionException('Could not extract archive');
102
+        }
100 103
 
101 104
         $size = strlen($data);
102 105
         $written = file_put_contents($outputFolder.$this->inArchiveFileName, $data);
Please login to merge, or discard this patch.
src/UnifiedArchive.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     public static function open($fileName, $password = null)
63 63
     {
64 64
         if (!file_exists($fileName) || !is_readable($fileName)) {
65
-            throw new InvalidArgumentException('Could not open file: ' . $fileName.' is not readable');
65
+            throw new InvalidArgumentException('Could not open file: '.$fileName.' is not readable');
66 66
         }
67 67
 
68 68
         $format = Formats::detectArchiveFormat($fileName);
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
     public function getFileData($fileName)
273 273
     {
274 274
         if (!in_array($fileName, $this->files, true)) {
275
-            throw new NonExistentArchiveFileException('File ' . $fileName . ' does not exist in archive');
275
+            throw new NonExistentArchiveFileException('File '.$fileName.' does not exist in archive');
276 276
         }
277 277
 
278 278
         return $this->archive->getFileData($fileName);
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
     public function getFileContent($fileName)
289 289
     {
290 290
         if (!in_array($fileName, $this->files, true)) {
291
-            throw new NonExistentArchiveFileException('File ' . $fileName . ' does not exist in archive');
291
+            throw new NonExistentArchiveFileException('File '.$fileName.' does not exist in archive');
292 292
         }
293 293
 
294 294
         return $this->archive->getFileContent($fileName);
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
     public function getFileStream($fileName)
305 305
     {
306 306
         if (!in_array($fileName, $this->files, true)) {
307
-            throw new NonExistentArchiveFileException('File ' . $fileName . ' does not exist in archive');
307
+            throw new NonExistentArchiveFileException('File '.$fileName.' does not exist in archive');
308 308
         }
309 309
 
310 310
         return $this->archive->getFileStream($fileName);
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
     public static function archiveFile($file, $archiveName, $compressionLevel = BasicDriver::COMPRESSION_AVERAGE, $password = null)
560 560
     {
561 561
         if (!is_file($file)) {
562
-            throw new InvalidArgumentException($file . ' is not a valid file to archive');
562
+            throw new InvalidArgumentException($file.' is not a valid file to archive');
563 563
         }
564 564
 
565 565
         return static::archiveFiles($file, $archiveName, $compressionLevel, $password) === 1;
@@ -630,8 +630,8 @@  discard block
 block discarded – undo
630 630
                 if (is_array($source)) {
631 631
                     foreach ($source as $sourceItem) {
632 632
                         static::importFilesFromDir(
633
-                            rtrim($sourceItem, '/\\*') . '/*',
634
-                            !empty($destination) ? $destination . '/' : null,
633
+                            rtrim($sourceItem, '/\\*').'/*',
634
+                            !empty($destination) ? $destination.'/' : null,
635 635
                             true,
636 636
                             $files
637 637
                         );
@@ -639,8 +639,8 @@  discard block
 block discarded – undo
639 639
                 } else if (is_dir($source)) {
640 640
                     // one source for directories
641 641
                     static::importFilesFromDir(
642
-                        rtrim($source, '/\\*') . '/*',
643
-                        !empty($destination) ? $destination . '/' : null,
642
+                        rtrim($source, '/\\*').'/*',
643
+                        !empty($destination) ? $destination.'/' : null,
644 644
                         true,
645 645
                         $files
646 646
                     );
Please login to merge, or discard this patch.
Braces   +44 added lines, -31 removed lines patch added patch discarded remove patch
@@ -251,13 +251,15 @@  discard block
 block discarded – undo
251 251
      */
252 252
     public function getFileNames($filter = null)
253 253
     {
254
-        if ($filter === null)
255
-            return $this->files;
254
+        if ($filter === null) {
255
+                    return $this->files;
256
+        }
256 257
 
257 258
         $result = [];
258 259
         foreach ($this->files as $file) {
259
-            if (fnmatch($filter, $file))
260
-                $result[] = $file;
260
+            if (fnmatch($filter, $file)) {
261
+                            $result[] = $file;
262
+            }
261 263
         }
262 264
         return $result;
263 265
     }
@@ -384,8 +386,9 @@  discard block
 block discarded – undo
384 386
     {
385 387
         $files_list = static::createFilesList($fileOrFiles);
386 388
 
387
-        if (empty($files_list))
388
-            throw new EmptyFileListException('Files list is empty!');
389
+        if (empty($files_list)) {
390
+                    throw new EmptyFileListException('Files list is empty!');
391
+        }
389 392
 
390 393
         $result = $this->archive->addFiles($files_list);
391 394
         $this->scanArchive();
@@ -404,8 +407,9 @@  discard block
 block discarded – undo
404 407
      */
405 408
     public function addFile($file, $inArchiveName = null)
406 409
     {
407
-        if (!is_file($file))
408
-            throw new InvalidArgumentException($file.' is not a valid file to add in archive');
410
+        if (!is_file($file)) {
411
+                    throw new InvalidArgumentException($file.' is not a valid file to add in archive');
412
+        }
409 413
 
410 414
         return ($inArchiveName !== null
411 415
                 ? $this->addFiles([$inArchiveName => $file])
@@ -438,8 +442,9 @@  discard block
 block discarded – undo
438 442
      */
439 443
     public function addDirectory($directory, $inArchivePath = null)
440 444
     {
441
-        if (!is_dir($directory) || !is_readable($directory))
442
-            throw new InvalidArgumentException($directory.' is not a valid directory to add in archive');
445
+        if (!is_dir($directory) || !is_readable($directory)) {
446
+                    throw new InvalidArgumentException($directory.' is not a valid directory to add in archive');
447
+        }
443 448
 
444 449
         return ($inArchivePath !== null
445 450
                 ? $this->addFiles([$inArchivePath => $directory])
@@ -463,13 +468,15 @@  discard block
 block discarded – undo
463 468
     {
464 469
         $archiveType = Formats::detectArchiveFormat($archiveName, false);
465 470
 
466
-        if ($archiveType === false)
467
-            throw new UnsupportedArchiveException('Could not detect archive type for name "'.$archiveName.'"');
471
+        if ($archiveType === false) {
472
+                    throw new UnsupportedArchiveException('Could not detect archive type for name "'.$archiveName.'"');
473
+        }
468 474
 
469 475
         $files_list = static::createFilesList($fileOrFiles);
470 476
 
471
-        if (empty($files_list))
472
-            throw new EmptyFileListException('Files list is empty!');
477
+        if (empty($files_list)) {
478
+                    throw new EmptyFileListException('Files list is empty!');
479
+        }
473 480
 
474 481
         $totalSize = 0;
475 482
         foreach ($files_list as $fn) {
@@ -521,16 +528,19 @@  discard block
 block discarded – undo
521 528
         $fileProgressCallable = null
522 529
  )
523 530
     {
524
-        if (file_exists($archiveName))
525
-            throw new FileAlreadyExistsException('Archive '.$archiveName.' already exists!');
531
+        if (file_exists($archiveName)) {
532
+                    throw new FileAlreadyExistsException('Archive '.$archiveName.' already exists!');
533
+        }
526 534
 
527 535
         $info = static::prepareForArchiving($fileOrFiles, $archiveName);
528 536
 
529
-        if (!Formats::canCreate($info['type']))
530
-            throw new UnsupportedArchiveException('Unsupported archive type: '.$info['type'].' of archive '.$archiveName);
537
+        if (!Formats::canCreate($info['type'])) {
538
+                    throw new UnsupportedArchiveException('Unsupported archive type: '.$info['type'].' of archive '.$archiveName);
539
+        }
531 540
 
532
-        if ($password !== null && !Formats::canEncrypt($info['type']))
533
-            throw new UnsupportedOperationException('Archive type '.$info['type'].' can not be encrypted');
541
+        if ($password !== null && !Formats::canEncrypt($info['type'])) {
542
+                    throw new UnsupportedOperationException('Archive type '.$info['type'].' can not be encrypted');
543
+        }
534 544
 
535 545
         /** @var BasicDriver $driver */
536 546
         $driver = Formats::getFormatDriver($info['type'], true);
@@ -578,8 +588,9 @@  discard block
 block discarded – undo
578 588
      */
579 589
     public static function archiveDirectory($directory, $archiveName, $compressionLevel = BasicDriver::COMPRESSION_AVERAGE, $password = null)
580 590
     {
581
-        if (!is_dir($directory) || !is_readable($directory))
582
-            throw new InvalidArgumentException($directory.' is not a valid directory to archive');
591
+        if (!is_dir($directory) || !is_readable($directory)) {
592
+                    throw new InvalidArgumentException($directory.' is not a valid directory to archive');
593
+        }
583 594
 
584 595
         return static::archiveFiles($directory, $archiveName, $compressionLevel, $password) > 0;
585 596
     }
@@ -615,9 +626,9 @@  discard block
 block discarded – undo
615 626
         if (is_array($nodes)) {
616 627
             foreach ($nodes as $destination => $source) {
617 628
                 // new format
618
-                if (is_numeric($destination))
619
-                    $destination = $source;
620
-                else {
629
+                if (is_numeric($destination)) {
630
+                                    $destination = $source;
631
+                } else {
621 632
                     // old format
622 633
                     if (is_string($source) && !file_exists($source)) {
623 634
                         list($destination, $source) = [$source, $destination];
@@ -651,11 +662,12 @@  discard block
 block discarded – undo
651 662
 
652 663
         } else if (is_string($nodes)) { // passed one file or directory
653 664
             // if is directory
654
-            if (is_dir($nodes))
655
-                static::importFilesFromDir(rtrim($nodes, '/\\*').'/*', null, true,
665
+            if (is_dir($nodes)) {
666
+                            static::importFilesFromDir(rtrim($nodes, '/\\*').'/*', null, true,
656 667
                     $files);
657
-            else if (is_file($nodes))
658
-                $files[basename($nodes)] = $nodes;
668
+            } else if (is_file($nodes)) {
669
+                            $files[basename($nodes)] = $nodes;
670
+            }
659 671
         }
660 672
 
661 673
         return $files;
@@ -672,8 +684,9 @@  discard block
 block discarded – undo
672 684
         // $map[$destination] = rtrim($source, '/*');
673 685
         // do not map root archive folder
674 686
 
675
-        if ($destination !== null)
676
-            $map[$destination] = null;
687
+        if ($destination !== null) {
688
+                    $map[$destination] = null;
689
+        }
677 690
 
678 691
         foreach (glob($source, GLOB_MARK) as $node) {
679 692
             if (in_array(substr($node, -1), ['/', '\\'], true) && $recursive) {
Please login to merge, or discard this patch.
src/Commands/CommentCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
         }
30 30
 
31 31
         if (!empty($previous_comment = $archive->getComment())) {
32
-            $output->writeln('Comment "' . $previous_comment . '" replaced', OutputInterface::OUTPUT_RAW);
32
+            $output->writeln('Comment "'.$previous_comment.'" replaced', OutputInterface::OUTPUT_RAW);
33 33
         } else if ($comment === null) {
34 34
             $output->writeln('Comment deleted', OutputInterface::OUTPUT_RAW);
35 35
         } else {
Please login to merge, or discard this patch.
src/Commands/ExtractArchiveCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@
 block discarded – undo
31 31
         $archive = $this->getArchive($input, $output);
32 32
 
33 33
         if (disk_free_space($output_dir) < $archive->getOriginalSize()) {
34
-            throw new \LogicException('Archive size ' . implode($this->formatSize($archive->getOriginalSize())) . ' is more that available on disk '
34
+            throw new \LogicException('Archive size '.implode($this->formatSize($archive->getOriginalSize())).' is more that available on disk '
35 35
                                       . implode($this->formatSize(disk_free_space($output_dir))));
36 36
         }
37 37
         $archive->extractFiles($output_dir, $entry_selector, true);
38
-        $output->writeln('<info>Extracted all archive contents (' . implode($this->formatSize($archive->getOriginalSize())) . ')</info>');
38
+        $output->writeln('<info>Extracted all archive contents ('.implode($this->formatSize($archive->getOriginalSize())).')</info>');
39 39
     }
40 40
 }
Please login to merge, or discard this patch.
src/Commands/AddFileCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             if (empty($destination)) {
49 49
                 throw new \LogicException('Source and destination can not be empty');
50 50
             }
51
-            $output->writeln('<info>Read ' . $data_size . ' from input</info>');
51
+            $output->writeln('<info>Read '.$data_size.' from input</info>');
52 52
         } else {
53 53
             $data_size = filesize($source);
54 54
         }
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
         }
76 76
         if ($added_files === 1) {
77 77
             $details = $archive->getFileData($destination);
78
-            $output->writeln('Added <comment>' . $source . '</comment>('
79
-                             . implode($this->formatSize($data_size)) . ') as '
80
-                             . $destination . ' ('
78
+            $output->writeln('Added <comment>'.$source.'</comment>('
79
+                             . implode($this->formatSize($data_size)).') as '
80
+                             . $destination.' ('
81 81
                              . implode($this->formatSize($details->compressedSize))
82 82
                              . ')');
83 83
         }
Please login to merge, or discard this patch.
src/Commands/InfoCommand.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@
 block discarded – undo
26 26
         $file = realpath($input->getArgument('archive'));
27 27
         $archive = $this->getArchive($input, $output);
28 28
 
29
-        $output->writeln('Filename: ' . $file . ' (changed <comment>' . $this->formatDate(filemtime($file)) . '</comment>)');
30
-        $output->writeln('Type: <info>' . $archive->getFormat() . '</info>, mime <info>' . $archive->getMimeType() . '</info> (via driver <comment>' . $archive->getDriverType() . '</comment>)');
31
-        $output->writeln('Contains: ' . $archive->countFiles() . ' file' . ($archive->countFiles() > 1 ? 's' : null));
29
+        $output->writeln('Filename: '.$file.' (changed <comment>'.$this->formatDate(filemtime($file)).'</comment>)');
30
+        $output->writeln('Type: <info>'.$archive->getFormat().'</info>, mime <info>'.$archive->getMimeType().'</info> (via driver <comment>'.$archive->getDriverType().'</comment>)');
31
+        $output->writeln('Contains: '.$archive->countFiles().' file'.($archive->countFiles() > 1 ? 's' : null));
32 32
         $output->writeln('Size:');
33
-        $output->writeln("\t". 'uncompressed: '.implode(' ', $this->formatSize($archive->getOriginalSize(), 2)));
34
-        $output->writeln("\t" . 'compressed: ' . implode(' ', $this->formatSize($archive->getCompressedSize(), 2)));
35
-        $output->writeln("\t" . 'ratio: <info>' . round($archive->getOriginalSize() / $archive->getCompressedSize(), 6) . '/1 (' . floor($archive->getCompressedSize() / $archive->getOriginalSize() * 100) . '%</info>)');
33
+        $output->writeln("\t".'uncompressed: '.implode(' ', $this->formatSize($archive->getOriginalSize(), 2)));
34
+        $output->writeln("\t".'compressed: '.implode(' ', $this->formatSize($archive->getCompressedSize(), 2)));
35
+        $output->writeln("\t".'ratio: <info>'.round($archive->getOriginalSize() / $archive->getCompressedSize(), 6).'/1 ('.floor($archive->getCompressedSize() / $archive->getOriginalSize() * 100).'%</info>)');
36 36
         if (!empty($comment = $archive->getComment()))
37
-            $output->writeln('Comment: <comment>' . $comment . '</comment>');
37
+            $output->writeln('Comment: <comment>'.$comment.'</comment>');
38 38
     }
39 39
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,8 @@
 block discarded – undo
33 33
         $output->writeln("\t". 'uncompressed: '.implode(' ', $this->formatSize($archive->getOriginalSize(), 2)));
34 34
         $output->writeln("\t" . 'compressed: ' . implode(' ', $this->formatSize($archive->getCompressedSize(), 2)));
35 35
         $output->writeln("\t" . 'ratio: <info>' . round($archive->getOriginalSize() / $archive->getCompressedSize(), 6) . '/1 (' . floor($archive->getCompressedSize() / $archive->getOriginalSize() * 100) . '%</info>)');
36
-        if (!empty($comment = $archive->getComment()))
37
-            $output->writeln('Comment: <comment>' . $comment . '</comment>');
36
+        if (!empty($comment = $archive->getComment())) {
37
+                    $output->writeln('Comment: <comment>' . $comment . '</comment>');
38
+        }
38 39
     }
39 40
 }
Please login to merge, or discard this patch.
src/Commands/ExtractFilesCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,6 +33,6 @@
 block discarded – undo
33 33
         $entry_selector = $input->getArgument('entrySelector');
34 34
 
35 35
         $archive->extractFiles($output_dir, $entry_selector, true);
36
-        $output->writeln('<info>Extracted:</info> ' . implode(', ', $entry_selector) . ' (' . count($entry_selector) . ') file(s)');
36
+        $output->writeln('<info>Extracted:</info> '.implode(', ', $entry_selector).' ('.count($entry_selector).') file(s)');
37 37
     }
38 38
 }
Please login to merge, or discard this patch.