Completed
Branch master (8d8119)
by Colin
14:56
created
src/ImageValidator.php 1 patch
Braces   +9 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@  discard block
 block discarded – undo
33 33
 		// Get the image dimension info, or fail.
34 34
 
35 35
 		$image_size = @getimagesize( $image );
36
-		if ($image_size===false) return false;
36
+		if ($image_size===false) {
37
+			return false;
38
+		}
37 39
 
38 40
 
39 41
 		// If only one dimension rule is passed, assume it applies to both height and width.
@@ -100,7 +102,9 @@  discard block
 block discarded – undo
100 102
 		// Get the image dimension info, or fail.
101 103
 
102 104
 		$image_size = @getimagesize( $image );
103
-		if ($image_size===false) return false;
105
+		if ($image_size===false) {
106
+			return false;
107
+		}
104 108
 
105 109
 		$image_width = $image_size[0];
106 110
 		$image_height = $image_size[1];
@@ -188,15 +192,13 @@  discard block
 block discarded – undo
188 192
 		{
189 193
 			$message = $this->translator->trans('image-validator::validation.anysize');
190 194
 			$pass = true;
191
-		}
192
-		else if ( preg_match('/^(\d+)\-(\d+)$/', $rule, $matches) )
195
+		} else if ( preg_match('/^(\d+)\-(\d+)$/', $rule, $matches) )
193 196
 		{
194 197
 			$size1 = intval($matches[1]);
195 198
 			$size2 = intval($matches[2]);
196 199
 			$message = $this->translator->trans('image-validator::validation.between', compact('size1','size2'));
197 200
 			$pass = ($dimension >= $size1) && ($dimension <= $size2);
198
-		}
199
-		else if ( preg_match('/^([<=>]*)(\d+)$/', $rule, $matches) )
201
+		} else if ( preg_match('/^([<=>]*)(\d+)$/', $rule, $matches) )
200 202
 		{
201 203
 
202 204
 			$size = intval($matches[2]);
@@ -228,8 +230,7 @@  discard block
 block discarded – undo
228 230
 					throw new \RuntimeException('Unknown image size validation rule: ' . $rule );
229 231
 			}
230 232
 
231
-		}
232
-		else
233
+		} else
233 234
 		{
234 235
 			throw new \RuntimeException('Unknown image size validation rule: ' . $rule );
235 236
 		}
Please login to merge, or discard this patch.