Passed
Push — main ( 12974e...2e34a9 )
by Jeremy
02:09
created
src/Validators/ValidatorShared.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
     {
11 11
         if (is_float($value + 0)) {
12 12
             // if less than zero and doesn't start with a zero
13
-            if ($value + 0 < 1 && ! str_starts_with($value, '0')) {
13
+            if ($value + 0 < 1 && !str_starts_with($value, '0')) {
14 14
                 throw new BadRequestException('Region values less than one require a leading zero.');
15 15
             }
16 16
             // option should not have an extra trailing zero
Please login to merge, or discard this patch.
src/Filters/SizeFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
         return $image->resize(
62 62
             $width,
63 63
             $height,
64
-            function ($constraint) use ($constrainAspectRatio, $width, $height) {
64
+            function($constraint) use ($constrainAspectRatio, $width, $height) {
65 65
                 if ($constrainAspectRatio || is_null($width) || is_null($height)) {
66 66
                     $constraint->aspectRatio();
67 67
                 }
Please login to merge, or discard this patch.
src/Filters/RegionFilter.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
 
48 48
         if (strpos($this->options[0], 'pct:') === false) {
49 49
             // iiif - x,y,w,h
50
-            $x = (int) $this->options[0];
51
-            $y = (int) $this->options[1];
52
-            $w = (int) $this->options[2];
53
-            $h = (int) $this->options[3];
50
+            $x = (int)$this->options[0];
51
+            $y = (int)$this->options[1];
52
+            $w = (int)$this->options[2];
53
+            $h = (int)$this->options[3];
54 54
 
55 55
             if (($x + $w) > $this->width) {
56 56
                 $w = $w - (($x + $w) - $this->width);
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
         }
66 66
 
67 67
         // iiif - x,y,w,h
68
-        $x = (int) round($this->width * substr($this->options[0], 4) / 100);
69
-        $y = (int) round($this->height * $this->options[1] / 100);
70
-        $w = (int) round($this->width * $this->options[2] / 100);
71
-        $h = (int) round($this->height * $this->options[3] / 100);
68
+        $x = (int)round($this->width * substr($this->options[0], 4) / 100);
69
+        $y = (int)round($this->height * $this->options[1] / 100);
70
+        $w = (int)round($this->width * $this->options[2] / 100);
71
+        $h = (int)round($this->height * $this->options[3] / 100);
72 72
 
73 73
         if ($this->options[2] + substr($this->options[0], 4) > 100) {
74 74
             $w = $this->width - $x;
Please login to merge, or discard this patch.
src/ImageIIIF.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         ];
50 50
 
51 51
         foreach ($parameters as $parameter => $options) {
52
-            if (! in_array($parameter, array_keys($iiifParameters))) {
52
+            if (!in_array($parameter, array_keys($iiifParameters))) {
53 53
                 continue;
54 54
             }
55 55
 
@@ -68,11 +68,11 @@  discard block
 block discarded – undo
68 68
         ];
69 69
 
70 70
         foreach ($parameters as $parameter => $value) {
71
-            if (! in_array($parameter, array_keys($validators))) {
71
+            if (!in_array($parameter, array_keys($validators))) {
72 72
                 continue;
73 73
             }
74 74
 
75
-            if (! (new $validators[$parameter]($this->config, $this->image))->valid($value)) {
75
+            if (!(new $validators[$parameter]($this->config, $this->image))->valid($value)) {
76 76
                 return false;
77 77
             }
78 78
         }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     {
110 110
         $scaleFactors = [];
111 111
         $maxSize = max($this->image->width(), $this->image->height());
112
-        $total = (int) ceil($maxSize / $this->config['tile_width']);
112
+        $total = (int)ceil($maxSize / $this->config['tile_width']);
113 113
         $factor = 1;
114 114
         while ($factor / 2 <= $total) {
115 115
             $scaleFactors[] = $factor;
Please login to merge, or discard this patch.
src/Validators/SizeValidator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
             throw new NotImplementedException("Maximum size is not implemented.");
34 34
         }
35 35
 
36
-        if (! $this->allow_upscaling && $this->upscale) {
36
+        if (!$this->allow_upscaling && $this->upscale) {
37 37
             throw new NotImplementedException("Upscaling is not allowed.");
38 38
         }
39 39
 
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
 
65 65
     protected function isValidPercent($value)
66 66
     {
67
-        $percent_value = (int) $this->getPercentValue($value);
68
-        if ($percent_value < 1 || ($percent_value > 100 && ! $this->upscale)) {
67
+        $percent_value = (int)$this->getPercentValue($value);
68
+        if ($percent_value < 1 || ($percent_value > 100 && !$this->upscale)) {
69 69
             throw new BadRequestException("Size $value is invalid.");
70 70
         }
71 71
 
Please login to merge, or discard this patch.