Passed
Push — master ( f9b91b...8ebbdd )
by Bjørn
08:33
created
src/Detectors/SniffFirstFourBytes.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -44,18 +44,18 @@  discard block
 block discarded – undo
44 44
                 $hexPatterns[] = ['image/x-icon', "/^00000(1?2)00/"];
45 45
 
46 46
                 if (preg_match("/^.{8}6A502020/", $sampleHex) === 1) {
47
-                  // jpeg-2000 - a bit more complex, as block size may vary
48
-                  // https://www.file-recovery.com/jp2-signature-format.htm
49
-                  $block1Size = hexdec("0x" . substr($sampleHex, 0, 8));
47
+                    // jpeg-2000 - a bit more complex, as block size may vary
48
+                    // https://www.file-recovery.com/jp2-signature-format.htm
49
+                    $block1Size = hexdec("0x" . substr($sampleHex, 0, 8));
50 50
 
51
-                  $moreBytes = @fread($handle, $block1Size + 4 + 8);
52
-                  if ($moreBytes !== false) {
51
+                    $moreBytes = @fread($handle, $block1Size + 4 + 8);
52
+                    if ($moreBytes !== false) {
53 53
                     $sampleBin .= $moreBytes;
54
-                  }
55
-                  if (substr($sampleBin, $block1Size + 4, 4) == 'ftyp') {
56
-                      $subtyp = substr($sampleBin, $block1Size + 8, 4);
57
-                      return 'image/' . rtrim($subtyp);
58
-                  }
54
+                    }
55
+                    if (substr($sampleBin, $block1Size + 4, 4) == 'ftyp') {
56
+                        $subtyp = substr($sampleBin, $block1Size + 8, 4);
57
+                        return 'image/' . rtrim($subtyp);
58
+                    }
59 59
                 }
60 60
 
61 61
                 break;
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
                 // Note that <xml> tag might be big too... - so we read in 200 extra
89 89
                 $moreBytes = @fread($handle, 200);
90 90
                 if ($moreBytes !== false) {
91
-                  $sampleBin .= $moreBytes;
91
+                    $sampleBin .= $moreBytes;
92 92
                 }
93 93
                 $binPatterns[] = ['image/svg+xml', "/^(<\?xml[^>]*\?>.*)?<svg/is"];
94 94
                 break;
Please login to merge, or discard this patch.