Completed
Push — master ( b3b676...8fdc21 )
by Alexey
06:06 queued 11s
created
src/Model/Extra/Fields/WinZipAesExtraField.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -121,8 +121,7 @@
 block discarded – undo
121 121
             $entry->getUncompressedSize() < 20 ||
122 122
             $entry->getCompressionMethod() === ZipCompressionMethod::BZIP2
123 123
         ) ?
124
-            self::VERSION_AE2 :
125
-            self::VERSION_AE1;
124
+            self::VERSION_AE2 : self::VERSION_AE1;
126 125
 
127 126
         $field = new self($vendorVersion, $keyStrength, $entry->getCompressionMethod());
128 127
 
Please login to merge, or discard this patch.
src/Model/ZipEntryMatcher.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $entries = (array) $entries;
35 35
         $entries = array_map(
36
-            static function ($entry) {
36
+            static function($entry) {
37 37
                 return $entry instanceof ZipEntry ? $entry->getName() : (string) $entry;
38 38
             },
39 39
             $entries
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
              * @param ZipEntry $entry
74 74
              * @param string   $entryName
75 75
              */
76
-            function (ZipEntry $entry, $entryName) use ($regexp) {
76
+            function(ZipEntry $entry, $entryName) use ($regexp) {
77 77
                 if (preg_match($regexp, $entryName)) {
78 78
                     $this->matches[] = (string) $entryName;
79 79
                 }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             array_walk(
109 109
                 $this->matches,
110 110
                 /** @param string $entryName */
111
-                static function ($entryName) use ($callable) {
111
+                static function($entryName) use ($callable) {
112 112
                     $callable($entryName);
113 113
                 }
114 114
             );
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         array_walk(
129 129
             $this->matches,
130 130
             /** @param string $entryName */
131
-            function ($entryName) {
131
+            function($entryName) {
132 132
                 $this->zipContainer->deleteEntry($entryName);
133 133
             }
134 134
         );
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         array_walk(
145 145
             $this->matches,
146 146
             /** @param string $entryName */
147
-            function ($entryName) use ($password, $encryptionMethod) {
147
+            function($entryName) use ($password, $encryptionMethod) {
148 148
                 $entry = $this->zipContainer->getEntry($entryName);
149 149
 
150 150
                 if (!$entry->isDirectory()) {
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         array_walk(
163 163
             $this->matches,
164 164
             /** @param string $entryName */
165
-            function ($entryName) use ($encryptionMethod) {
165
+            function($entryName) use ($encryptionMethod) {
166 166
                 $entry = $this->zipContainer->getEntry($entryName);
167 167
 
168 168
                 if (!$entry->isDirectory()) {
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         array_walk(
178 178
             $this->matches,
179 179
             /** @param string $entryName */
180
-            function ($entryName) {
180
+            function($entryName) {
181 181
                 $entry = $this->zipContainer->getEntry($entryName);
182 182
 
183 183
                 if (!$entry->isDirectory()) {
Please login to merge, or discard this patch.
src/Model/ZipEntry.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -268,8 +268,7 @@
 block discarded – undo
268 268
             $this->extractVersion = max(
269 269
                 $this->extractVersion,
270 270
                 $this->isDirectory ?
271
-                    ZipVersion::v20_DEFLATED_FOLDER_ZIPCRYPTO :
272
-                    ZipVersion::v10_DEFAULT_MIN
271
+                    ZipVersion::v20_DEFLATED_FOLDER_ZIPCRYPTO : ZipVersion::v10_DEFAULT_MIN
273 272
             );
274 273
         }
275 274
 
Please login to merge, or discard this patch.
src/ZipFile.php 2 patches
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
     public function openFile($filename, array $options = [])
104 104
     {
105 105
         if (!file_exists($filename)) {
106
-            throw new ZipException("File {$filename} does not exist.");
106
+            throw new ZipException("file {$filename} does not exist.");
107 107
         }
108 108
 
109 109
         if (!($handle = @fopen($filename, 'rb'))) {
110
-            throw new ZipException("File {$filename} can't open.");
110
+            throw new ZipException("file {$filename} can't open.");
111 111
         }
112 112
 
113 113
         return $this->openFromStream($handle, $options);
@@ -1793,7 +1793,7 @@  discard block
 block discarded – undo
1793 1793
             $this->close();
1794 1794
 
1795 1795
             if (!($handle = @fopen($meta['uri'], 'rb'))) {
1796
-                throw new ZipException("File {$meta['uri']} can't open.");
1796
+                throw new ZipException("file {$meta['uri']} can't open.");
1797 1797
             }
1798 1798
         } else {
1799 1799
             $handle = @fopen('php://temp', 'r+b');
Please login to merge, or discard this patch.
Spacing   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -559,8 +559,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Util/FilesUtil.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -275,7 +275,7 @@
 block discarded – undo
275 275
             '/',
276 276
             array_filter(
277 277
                 explode('/', (string) $path),
278
-                static function ($part) {
278
+                static function($part) {
279 279
                     return $part !== '.' && $part !== '..';
280 280
                 }
281 281
             )
Please login to merge, or discard this patch.
src/Util/FileAttribUtil.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
         if ($permission & self::UNX_IXUSR) {
82 82
             $mode .= ($permission & self::UNX_ISUID) ? 's' : 'x';
83 83
         } else {
84
-            $mode .= ($permission & self::UNX_ISUID) ? 'S' : '-';  // S==undefined
84
+            $mode .= ($permission & self::UNX_ISUID) ? 'S' : '-'; // S==undefined
85 85
         }
86 86
         $mode .= ($permission & self::UNX_IRGRP) ? 'r' : '-';
87 87
         $mode .= ($permission & self::UNX_IWGRP) ? 'w' : '-';
Please login to merge, or discard this patch.
src/Util/DateTimeConverter.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -55,11 +55,11 @@
 block discarded – undo
55 55
         }
56 56
 //        date_default_timezone_set('UTC');
57 57
         return mktime(
58
-            (($dosTime >> 11) & 0x1f),         // hours
59
-            (($dosTime >> 5) & 0x3f),          // minutes
60
-            (($dosTime << 1) & 0x3e),          // seconds
61
-            (($dosTime >> 21) & 0x0f),         // month
62
-            (($dosTime >> 16) & 0x1f),         // day
58
+            (($dosTime >> 11) & 0x1f), // hours
59
+            (($dosTime >> 5) & 0x3f), // minutes
60
+            (($dosTime << 1) & 0x3e), // seconds
61
+            (($dosTime >> 21) & 0x0f), // month
62
+            (($dosTime >> 16) & 0x1f), // day
63 63
             ((($dosTime >> 25) & 0x7f) + 1980) // year
64 64
         );
65 65
     }
Please login to merge, or discard this patch.
src/IO/Filter/Cipher/Pkware/PKEncryptionStreamFilter.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,7 @@
 block discarded – undo
67 67
         $this->context = new PKCryptContext($password);
68 68
 
69 69
         $crc = $entry->isDataDescriptorRequired() || $entry->getCrc() === ZipEntry::UNKNOWN ?
70
-            ($entry->getDosTime() & 0x0000ffff) << 16 :
71
-            $entry->getCrc();
70
+            ($entry->getDosTime() & 0x0000ffff) << 16 : $entry->getCrc();
72 71
 
73 72
         try {
74 73
             $headerBytes = random_bytes(PKCryptContext::STD_DEC_HDR_SIZE);
Please login to merge, or discard this patch.
src/IO/ZipWriter.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -267,8 +267,7 @@  discard block
 block discarded – undo
267 267
     {
268 268
         $local = (bool) $local;
269 269
         $collection = $local ?
270
-            $entry->getLocalExtraFields() :
271
-            $entry->getCdExtraFields();
270
+            $entry->getLocalExtraFields() : $entry->getCdExtraFields();
272 271
         $extraData = '';
273 272
 
274 273
         foreach ($collection as $extraField) {
@@ -767,7 +766,7 @@  discard block
 block discarded – undo
767 766
             // find max software version, version needed to extract and most common platform
768 767
             list($softwareVersion, $versionNeededToExtract) = array_reduce(
769 768
                 $this->zipContainer->getEntries(),
770
-                static function (array $carry, ZipEntry $entry) {
769
+                static function(array $carry, ZipEntry $entry) {
771 770
                     $carry[0] = max($carry[0], $entry->getSoftwareVersion() & 0xFF);
772 771
                     $carry[1] = max($carry[1], $entry->getExtractVersion() & 0xFF);
773 772
 
Please login to merge, or discard this patch.