@@ -559,8 +559,7 @@ discard block |
||
| 559 | 559 | } else { |
| 560 | 560 | $mimeType = FilesUtil::getMimeTypeFromString($contents); |
| 561 | 561 | $compressionMethod = FilesUtil::isBadCompressionMimeType($mimeType) ? |
| 562 | - ZipCompressionMethod::STORED : |
|
| 563 | - ZipCompressionMethod::DEFLATED; |
|
| 562 | + ZipCompressionMethod::STORED : ZipCompressionMethod::DEFLATED; |
|
| 564 | 563 | } |
| 565 | 564 | } |
| 566 | 565 | |
@@ -661,8 +660,7 @@ discard block |
||
| 661 | 660 | $compressionMethod = ZipCompressionMethod::STORED; |
| 662 | 661 | } else { |
| 663 | 662 | $compressionMethod = FilesUtil::isBadCompressionFile($file->getPathname()) ? |
| 664 | - ZipCompressionMethod::STORED : |
|
| 665 | - ZipCompressionMethod::DEFLATED; |
|
| 663 | + ZipCompressionMethod::STORED : ZipCompressionMethod::DEFLATED; |
|
| 666 | 664 | } |
| 667 | 665 | |
| 668 | 666 | $zipEntry->setCompressionMethod($compressionMethod); |
@@ -805,8 +803,7 @@ discard block |
||
| 805 | 803 | rewind($stream); |
| 806 | 804 | $mimeType = FilesUtil::getMimeTypeFromString($bufferContents); |
| 807 | 805 | $compressionMethod = FilesUtil::isBadCompressionMimeType($mimeType) ? |
| 808 | - ZipCompressionMethod::STORED : |
|
| 809 | - ZipCompressionMethod::DEFLATED; |
|
| 806 | + ZipCompressionMethod::STORED : ZipCompressionMethod::DEFLATED; |
|
| 810 | 807 | } |
| 811 | 808 | $zipEntry->setUncompressedSize($length); |
| 812 | 809 | } |
@@ -973,8 +970,7 @@ discard block |
||
| 973 | 970 | } |
| 974 | 971 | |
| 975 | 972 | $iterator = $iterator instanceof \RecursiveIterator ? |
| 976 | - new \RecursiveIteratorIterator($iterator) : |
|
| 977 | - new \IteratorIterator($iterator); |
|
| 973 | + new \RecursiveIteratorIterator($iterator) : new \IteratorIterator($iterator); |
|
| 978 | 974 | /** |
| 979 | 975 | * @var string[] $files |
| 980 | 976 | * @var string $path |
@@ -111,11 +111,11 @@ |
||
| 111 | 111 | public function openFile($filename, array $options = []) |
| 112 | 112 | { |
| 113 | 113 | if (!file_exists($filename)) { |
| 114 | - throw new ZipException("File {$filename} does not exist."); |
|
| 114 | + throw new ZipException("file {$filename} does not exist."); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | if (!($handle = @fopen($filename, 'rb'))) { |
| 118 | - throw new ZipException("File {$filename} can't open."); |
|
| 118 | + throw new ZipException("file {$filename} can't open."); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | return $this->openFromStream($handle, $options); |
@@ -51,8 +51,7 @@ discard block |
||
| 51 | 51 | $resourceId = (int) $this->stream; |
| 52 | 52 | self::$guardClonedStream[$resourceId] = |
| 53 | 53 | isset(self::$guardClonedStream[$resourceId]) ? |
| 54 | - self::$guardClonedStream[$resourceId] + 1 : |
|
| 55 | - 0; |
|
| 54 | + self::$guardClonedStream[$resourceId] + 1 : 0; |
|
| 56 | 55 | } |
| 57 | 56 | |
| 58 | 57 | /** |
@@ -102,8 +101,7 @@ discard block |
||
| 102 | 101 | $resourceId = (int) $this->stream; |
| 103 | 102 | self::$guardClonedStream[$resourceId] = |
| 104 | 103 | isset(self::$guardClonedStream[$resourceId]) ? |
| 105 | - self::$guardClonedStream[$resourceId] + 1 : |
|
| 106 | - 1; |
|
| 104 | + self::$guardClonedStream[$resourceId] + 1 : 1; |
|
| 107 | 105 | } |
| 108 | 106 | |
| 109 | 107 | /** |
@@ -276,7 +276,7 @@ |
||
| 276 | 276 | \DIRECTORY_SEPARATOR, |
| 277 | 277 | array_filter( |
| 278 | 278 | explode('/', (string) $path), |
| 279 | - static function ($part) { |
|
| 279 | + static function($part) { |
|
| 280 | 280 | return $part !== '.' && $part !== '..'; |
| 281 | 281 | } |
| 282 | 282 | ) |