Completed
Push — master ( 05b722...3814de )
by dan
01:59
created
ImageProcessing/FocusCropDataCalculator.php 2 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
      * @param string $axis
98 98
      * @param        $cropCoordinates
99 99
      * @param        $aspectRatio
100
-     * @param        $newWidth
101
-     * @param        $newHeight
100
+     * @param        integer $newWidth
101
+     * @param        integer $newHeight
102 102
      *
103 103
      * @return array
104 104
      */
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     }
160 160
 
161 161
     /**
162
-     * @param        $axis
162
+     * @param        string $axis
163 163
      * @param string $type
164 164
      *
165 165
      * @return mixed
@@ -255,10 +255,10 @@  discard block
 block discarded – undo
255 255
     }
256 256
 
257 257
     /**
258
-     * @param $focusNear
258
+     * @param double $focusNear
259 259
      * @param $focusFar
260 260
      * @param $cropLength
261
-     * @param $imageLength
261
+     * @param integer $imageLength
262 262
      *
263 263
      * @return array
264 264
      */
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
      * Tests if a given offset is valid.
297 297
      * Valid offsets cropped images will include the focus rectangle and will not fall outside of the original image.
298 298
      *
299
-     * @param $point
299
+     * @param integer $point
300 300
      * @param $cropLength
301 301
      * @param $imageLength
302 302
      * @param $focusNear
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -77,11 +77,9 @@  discard block
 block discarded – undo
77 77
 
78 78
         if ($imageAspectRatio > $styleAspectRatio) {
79 79
             $axis = 'x';
80
-        }
81
-        else if ($imageAspectRatio < $styleAspectRatio) {
80
+        } else if ($imageAspectRatio < $styleAspectRatio) {
82 81
             $axis = 'y';
83
-        }
84
-        else {
82
+        } else {
85 83
             return [
86 84
                 'width'  => $newWidth,
87 85
                 'height' => $newHeight,
@@ -114,8 +112,7 @@  discard block
 block discarded – undo
114 112
             // How many times the style height goes into the new height
115 113
             $scaleFactor = $newHeight / $this->styleHeight;
116 114
             $cropWidth = $this->styleWidth * $scaleFactor;
117
-        }
118
-        else {
115
+        } else {
119 116
             $cropWidth = $newWidth;
120 117
 
121 118
             // How many times the style height goes into the new height
@@ -178,8 +175,7 @@  discard block
 block discarded – undo
178 175
 
179 176
         if ($type == 'near') {
180 177
             $point = ${'focus' . $axis . '1'} - ${'crop' . $axis . '1'};
181
-        }
182
-        else {
178
+        } else {
183 179
             $point = ${'focus' . $axis . '2'} - ${'crop' . $axis . '1'};
184 180
         }
185 181
 
Please login to merge, or discard this patch.
Tests/ImageProcessing/FocusCropDataCalculatorTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,8 +61,8 @@
 block discarded – undo
61 61
                 $message = 'Too wide: ' . $focusCropData['width'] . '<=' . $width;
62 62
                 $this->assertTrue($focusCropData['width'] <= $width, $message);
63 63
 
64
-                $message = 'Too high: ' . (int)round($focusCropData['height']) . ' <= ' . $height;
65
-                $this->assertTrue((int)round($focusCropData['height']) <= (int)$height, $message);
64
+                $message = 'Too high: ' . (int) round($focusCropData['height']) . ' <= ' . $height;
65
+                $this->assertTrue((int) round($focusCropData['height']) <= (int) $height, $message);
66 66
 
67 67
                 $this->assertTrue($focusCropData['x'] >= $imageCoordinates['crop_coordinates'][0]); // x1
68 68
                 $this->assertTrue($focusCropData['y'] >= $imageCoordinates['crop_coordinates'][1]); // y1
Please login to merge, or discard this patch.