Passed
Push — master ( 1965fd...6ab59c )
by f
11:34 queued 15s
created
src/Drivers/OneFile/OneFileDriver.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
     {
52 52
         $suffix = Formats::getFormatExtension(static::FORMAT);
53 53
         if ($suffix === null) {
54
-            throw new \Exception('Format suffix is empty for ' . static::FORMAT . ', it should be initialized!');
54
+            throw new \Exception('Format suffix is empty for '.static::FORMAT.', it should be initialized!');
55 55
         }
56 56
         if ($password !== null) {
57
-            throw new UnsupportedOperationException($suffix . ' archive does not support password!');
57
+            throw new UnsupportedOperationException($suffix.' archive does not support password!');
58 58
         }
59 59
 
60 60
         parent::__construct($archiveFileName, $format);
61
-        $this->inArchiveFileName = basename($archiveFileName, '.' . $suffix);
61
+        $this->inArchiveFileName = basename($archiveFileName, '.'.$suffix);
62 62
     }
63 63
 
64 64
     /**
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function extractArchive($outputFolder)
124 124
     {
125
-        if(method_exists($this, 'streamToFile')){
125
+        if (method_exists($this, 'streamToFile')) {
126 126
             $this->streamToFile($outputFolder.$this->inArchiveFileName);
127
-        }else{
127
+        } else {
128 128
             $data = $this->getFileContent($this->inArchiveFileName);
129 129
             if ($data === false)
130 130
                 throw new ArchiveExtractionException('Could not extract archive');
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -124,10 +124,11 @@
 block discarded – undo
124 124
     {
125 125
         if(method_exists($this, 'streamToFile')){
126 126
             $this->streamToFile($outputFolder.$this->inArchiveFileName);
127
-        }else{
127
+        } else{
128 128
             $data = $this->getFileContent($this->inArchiveFileName);
129
-            if ($data === false)
130
-                throw new ArchiveExtractionException('Could not extract archive');
129
+            if ($data === false) {
130
+                            throw new ArchiveExtractionException('Could not extract archive');
131
+            }
131 132
 
132 133
             $size = strlen($data);
133 134
             $written = file_put_contents($outputFolder.$this->inArchiveFileName, $data);
Please login to merge, or discard this patch.
src/Drivers/OneFile/Gzip.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     {
27 27
         $fp = fopen($file, 'rb');
28 28
         if (filesize($file) < 18 || strcmp(fread($fp, 2), "\x1f\x8b")) {
29
-            return false;  // Not GZIP format (See RFC 1952)
29
+            return false; // Not GZIP format (See RFC 1952)
30 30
         }
31 31
         $method = fread($fp, 1);
32 32
         $flags = fread($fp, 1);
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
         $fp = fopen($targetPath, "w");
99 99
         while (!gzeof($sfp)) {
100 100
             $chunk = gzread($sfp, 8192);
101
-            if($chunk === 0 || $chunk === false)
101
+            if ($chunk === 0 || $chunk === false)
102 102
                 throw new ArchiveExtractionException('Cannot read gzip chunk');
103
-            if(fwrite($fp, $chunk, strlen($chunk)) === false)
103
+            if (fwrite($fp, $chunk, strlen($chunk)) === false)
104 104
                 throw new ArchiveExtractionException('Cannot write gzip chunk');
105 105
         }
106 106
         gzclose($sfp);
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -98,10 +98,12 @@
 block discarded – undo
98 98
         $fp = fopen($targetPath, "w");
99 99
         while (!gzeof($sfp)) {
100 100
             $chunk = gzread($sfp, 8192);
101
-            if($chunk === 0 || $chunk === false)
102
-                throw new ArchiveExtractionException('Cannot read gzip chunk');
103
-            if(fwrite($fp, $chunk, strlen($chunk)) === false)
104
-                throw new ArchiveExtractionException('Cannot write gzip chunk');
101
+            if($chunk === 0 || $chunk === false) {
102
+                            throw new ArchiveExtractionException('Cannot read gzip chunk');
103
+            }
104
+            if(fwrite($fp, $chunk, strlen($chunk)) === false) {
105
+                            throw new ArchiveExtractionException('Cannot write gzip chunk');
106
+            }
105 107
         }
106 108
         gzclose($sfp);
107 109
         fclose($fp);
Please login to merge, or discard this patch.