Completed
Push — master ( 561cc0...c28280 )
by Derek Stephen
02:26
created
src/Image.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      */
91 91
     private function setPermissions($filename, $permissions)
92 92
     {
93
-        if( $permissions !== null) {
93
+        if ($permissions !== null) {
94 94
             chmod($filename, (int) $permissions);
95 95
         }
96 96
     }
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
                 imagegif($this->image);
125 125
                 break;
126 126
             case IMAGETYPE_PNG:
127
-                imagealphablending($this->image,true);
128
-                imagesavealpha($this->image,true);
127
+                imagealphablending($this->image, true);
128
+                imagesavealpha($this->image, true);
129 129
                 imagepng($this->image);
130 130
                 break;
131 131
         }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
     {
155 155
         $ratio = $height / $this->getHeight();
156 156
         $width = $this->getWidth() * $ratio;
157
-        $this->resize($width,$height);
157
+        $this->resize($width, $height);
158 158
     }
159 159
 
160 160
     /**
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
     {
165 165
         $ratio = $width / $this->getWidth();
166 166
         $height = $this->getHeight() * $ratio;
167
-        $this->resize($width,$height);
167
+        $this->resize($width, $height);
168 168
     }
169 169
 
170 170
     /**
@@ -174,29 +174,29 @@  discard block
 block discarded – undo
174 174
     {
175 175
         $width = $this->getWidth() * $scale / 100;
176 176
         $height = $this->getHeight() * $scale / 100;
177
-        $this->resize($width,$height);
177
+        $this->resize($width, $height);
178 178
     }
179 179
 
180 180
     /**
181 181
      * @param int $width
182 182
      * @param int $height
183 183
      */
184
-    public function resizeAndCrop($width,$height)
184
+    public function resizeAndCrop($width, $height)
185 185
     {
186 186
         $targetRatio = $width / $height;
187 187
         $actualRatio = $this->getWidth() / $this->getHeight();
188 188
 
189 189
         if ($targetRatio == $actualRatio) {
190 190
             // Scale to size
191
-            $this->resize($width,$height);
191
+            $this->resize($width, $height);
192 192
         } elseif ($targetRatio > $actualRatio) {
193 193
             // Resize to width, crop extra height
194 194
             $this->resizeToWidth($width);
195
-            $this->crop($width,$height);
195
+            $this->crop($width, $height);
196 196
         } else {
197 197
             // Resize to height, crop additional width
198 198
             $this->resizeToHeight($height);
199
-            $this->crop($width,$height);
199
+            $this->crop($width, $height);
200 200
         }
201 201
     }
202 202
 
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
      *  @param int $width
207 207
      *  @param int $height
208 208
      */
209
-    public function resize($width,$height)
209
+    public function resize($width, $height)
210 210
     {
211 211
         $newImage = imagecreatetruecolor($width, $height);
212 212
 
213
-        if ( ($this->getImageType() == IMAGETYPE_GIF) || ($this->getImageType()  == IMAGETYPE_PNG) ) {
213
+        if (($this->getImageType() == IMAGETYPE_GIF) || ($this->getImageType() == IMAGETYPE_PNG)) {
214 214
 
215 215
             // Get transparency color's index number
216 216
             $transparency = imagecolortransparent($this->image);
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
      * @param int $height
279 279
      * @param string $trim
280 280
      */
281
-    public function crop($width,$height, $trim = 'center')
281
+    public function crop($width, $height, $trim = 'center')
282 282
     {
283 283
         $offsetX = 0;
284 284
         $offsetY = 0;
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
             }
297 297
         }
298 298
 
299
-        $newImage = imagecreatetruecolor($width,$height);
299
+        $newImage = imagecreatetruecolor($width, $height);
300 300
         imagecopyresampled($newImage, $this->image, 0, 0, $offsetX, $offsetY, $width, $height, $width, $height);
301 301
         $this->image = $newImage;
302 302
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -221,7 +221,7 @@
 block discarded – undo
221 221
                 // deal with alpha channels
222 222
                 $this->prepWithExistingIndex($newImage, $transparency);
223 223
 
224
-            }  elseif ($this->getImageType() == IMAGETYPE_PNG) {
224
+            } elseif ($this->getImageType() == IMAGETYPE_PNG) {
225 225
 
226 226
                 // deal with alpha channels
227 227
                 $this->prepTransparentPng($newImage);
Please login to merge, or discard this patch.