@@ -237,8 +237,8 @@ |
||
237 | 237 | if ($code == 0 || $code == 2 || is_null($code)) { |
238 | 238 | // rewrite original file |
239 | 239 | if (rename($this->tmp2, $this->path) !== true) { |
240 | - throw new \RuntimeException(__FILE__ . ', line ' . __LINE__ . |
|
241 | - ': Could not replace original file ' . $this->path); |
|
240 | + throw new \RuntimeException(__FILE__.', line '.__LINE__. |
|
241 | + ': Could not replace original file '.$this->path); |
|
242 | 242 | } |
243 | 243 | } else { |
244 | 244 | throw new \RuntimeException(__FILE__.', line '.__LINE__. |
@@ -120,11 +120,11 @@ discard block |
||
120 | 120 | $this->files[$file->Location] = $directory.$file->strd_FileId; |
121 | 121 | $this->filesSize += $file->DataLen; |
122 | 122 | |
123 | - $this->filesData[$directory . $file->strd_FileId] = |
|
123 | + $this->filesData[$directory.$file->strd_FileId] = |
|
124 | 124 | [ |
125 | 125 | 'size' => $file->DataLen, |
126 | 126 | 'mtime' => |
127 | - strtotime((string)$file->isoRecDate), |
|
127 | + strtotime((string) $file->isoRecDate), |
|
128 | 128 | ]; |
129 | 129 | } |
130 | 130 | } |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | return false; |
173 | 173 | |
174 | 174 | return new ArchiveEntry($fileName, $this->filesData[$fileName]['size'], |
175 | - $this->filesData[$fileName]['size'], $this->filesData[$fileName]['mtime'],false); |
|
175 | + $this->filesData[$fileName]['size'], $this->filesData[$fileName]['mtime'], false); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
@@ -47,7 +47,7 @@ |
||
47 | 47 | |
48 | 48 | public static function getDescription() |
49 | 49 | { |
50 | - return 'adapter for ext-zip'.(extension_loaded('zip') && defined('\ZipArchive::LIBZIP_VERSION') ? ' ('. ZipArchive::LIBZIP_VERSION.')' : null); |
|
50 | + return 'adapter for ext-zip'.(extension_loaded('zip') && defined('\ZipArchive::LIBZIP_VERSION') ? ' ('.ZipArchive::LIBZIP_VERSION.')' : null); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | public static function getInstallationInstruction() |
@@ -15,7 +15,7 @@ |
||
15 | 15 | { |
16 | 16 | $fp = fopen($file, 'rb'); |
17 | 17 | if (filesize($file) < 18 || strcmp(fread($fp, 2), "\x1f\x8b")) { |
18 | - return false; // Not GZIP format (See RFC 1952) |
|
18 | + return false; // Not GZIP format (See RFC 1952) |
|
19 | 19 | } |
20 | 20 | $method = fread($fp, 1); |
21 | 21 | $flags = fread($fp, 1); |
@@ -5,7 +5,7 @@ |
||
5 | 5 | |
6 | 6 | class Bzip extends OneFileDriver |
7 | 7 | { |
8 | - const FORMAT_SUFFIX = 'bz2'; |
|
8 | + const FORMAT_SUFFIX = 'bz2'; |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * @return array |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | } |
531 | 531 | } |
532 | 532 | |
533 | - call_user_func(function ($directory) { |
|
533 | + call_user_func(function($directory) { |
|
534 | 534 | foreach (glob($directory.'/*') as $f) { |
535 | 535 | if (is_dir($f)) call_user_func(__FUNCTION__, $f); |
536 | 536 | else unlink($f); |
@@ -559,16 +559,16 @@ discard block |
||
559 | 559 | $filters = array(); |
560 | 560 | if (isset($options[PCLZIP_OPT_REMOVE_PATH]) |
561 | 561 | && !isset($options[PCLZIP_OPT_REMOVE_ALL_PATH])) |
562 | - $filters[] = function (&$key, &$value) use ($options) { |
|
562 | + $filters[] = function(&$key, &$value) use ($options) { |
|
563 | 563 | $key = str_replace($key, null, $key); |
564 | 564 | }; |
565 | 565 | if (isset($options[PCLZIP_OPT_REMOVE_ALL_PATH])) |
566 | - $filters[] = function (&$key, &$value) { |
|
566 | + $filters[] = function(&$key, &$value) { |
|
567 | 567 | $key = basename($key); |
568 | 568 | }; |
569 | 569 | if (isset($options[PCLZIP_OPT_ADD_PATH])) |
570 | - $filters[] = function (&$key, &$value) use ($options) { |
|
571 | - $key = rtrim($options[PCLZIP_OPT_ADD_PATH], '/') . '/' . |
|
570 | + $filters[] = function(&$key, &$value) use ($options) { |
|
571 | + $key = rtrim($options[PCLZIP_OPT_ADD_PATH], '/').'/'. |
|
572 | 572 | ltrim($key, '/'); |
573 | 573 | }; |
574 | 574 | return $filters; |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | */ |
583 | 583 | private function extractCallbacks(array $options, $preCallbackConst, $postCallbackConst) |
584 | 584 | { |
585 | - $preCallback = $postCallback = function () { return true; }; |
|
585 | + $preCallback = $postCallback = function() { return true; }; |
|
586 | 586 | |
587 | 587 | if (isset($options[$preCallbackConst]) && is_callable($options[$preCallbackConst])) |
588 | 588 | $preCallback = $options[$preCallbackConst]; |
@@ -600,8 +600,8 @@ discard block |
||
600 | 600 | private function makeKeyValueArrayFromList(array $options) |
601 | 601 | { |
602 | 602 | return array_combine( |
603 | - array_filter($options, function ($v) {return (bool) $v&2;}), |
|
604 | - array_filter($options, function ($v) {return (bool) ($v-1)&2;}) |
|
603 | + array_filter($options, function($v) {return (bool) $v&2; }), |
|
604 | + array_filter($options, function($v) {return (bool) ($v - 1)&2; }) |
|
605 | 605 | ); |
606 | 606 | } |
607 | 607 | |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | range($parts[0], $parts[1]), $allowedIndexes); |
650 | 650 | } |
651 | 651 | |
652 | - return function ($key, $value, $index) use ($allowedIndexes) { |
|
652 | + return function($key, $value, $index) use ($allowedIndexes) { |
|
653 | 653 | return in_array($index, $allowedIndexes) |
654 | 654 | ? self::SELECT_FILTER_PASS |
655 | 655 | : self::SELECT_FILTER_REFUSE; |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | ? $names |
667 | 667 | : explode(',', $names); |
668 | 668 | |
669 | - return function ($key, $value) use ($allowedNames) { |
|
669 | + return function($key, $value) use ($allowedNames) { |
|
670 | 670 | foreach ($allowedNames as $name) { |
671 | 671 | // select directory with nested files |
672 | 672 | if (in_array(substr($name, -1), ['/', '\\'])) { |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | */ |
695 | 695 | protected function createByEregSelector($regex) |
696 | 696 | { |
697 | - return function ($key, $value) use ($regex) { |
|
697 | + return function($key, $value) use ($regex) { |
|
698 | 698 | return (ereg($regex, $key) !== false) |
699 | 699 | ? self::SELECT_FILTER_PASS |
700 | 700 | : self::SELECT_FILTER_REFUSE; |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | */ |
708 | 708 | protected function createByPregSelector($regex) |
709 | 709 | { |
710 | - return function ($key, $value) use ($regex) { |
|
710 | + return function($key, $value) use ($regex) { |
|
711 | 711 | return preg_match($regex, $key) |
712 | 712 | ? self::SELECT_FILTER_PASS |
713 | 713 | : self::SELECT_FILTER_REFUSE; |
@@ -734,7 +734,7 @@ discard block |
||
734 | 734 | $selectFilter = $this->createByIndexSelector($options[PCLZIP_OPT_BY_INDEX]); |
735 | 735 | // no rule |
736 | 736 | else |
737 | - $selectFilter = function () { |
|
737 | + $selectFilter = function() { |
|
738 | 738 | return self::SELECT_FILTER_PASS; |
739 | 739 | }; |
740 | 740 | return $selectFilter; |
@@ -774,9 +774,9 @@ discard block |
||
774 | 774 | if (isset($options[PCLZIP_OPT_COMMENT])) |
775 | 775 | $comment = $options[PCLZIP_OPT_COMMENT]; |
776 | 776 | else if (isset($options[PCLZIP_OPT_ADD_COMMENT])) {; |
777 | - $comment = $currentComment . $options[PCLZIP_OPT_ADD_COMMENT]; |
|
777 | + $comment = $currentComment.$options[PCLZIP_OPT_ADD_COMMENT]; |
|
778 | 778 | } else if (isset($options[PCLZIP_OPT_PREPEND_COMMENT])) { |
779 | - $comment = $options[PCLZIP_OPT_PREPEND_COMMENT] . $currentComment; |
|
779 | + $comment = $options[PCLZIP_OPT_PREPEND_COMMENT].$currentComment; |
|
780 | 780 | } |
781 | 781 | return $comment; |
782 | 782 | } |
@@ -62,7 +62,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | ); |
@@ -29,7 +29,7 @@ |
||
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 { |
@@ -31,10 +31,10 @@ |
||
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 | } |