Skip to content

Commit 8bb08fb

Browse files
committed
Replace operator "or" with "||"
1 parent 6b2a329 commit 8bb08fb

File tree

8 files changed

+27
-26
lines changed

8 files changed

+27
-26
lines changed

src/Manipulators/Blur.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public function getBlur(): ?int
3434
$blur = $this->getParam('blur');
3535

3636
if (!is_numeric($blur)
37-
or $blur < 0
38-
or $blur > 100
37+
|| $blur < 0
38+
|| $blur > 100
3939
) {
4040
return null;
4141
}

src/Manipulators/Brightness.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public function getBrightness(): ?int
3434
$bri = (string) $this->getParam('bri');
3535

3636
if ('' === $bri
37-
or !preg_match('/^-*[0-9]+$/', $bri)
38-
or $bri < -100
39-
or $bri > 100
37+
|| !preg_match('/^-*[0-9]+$/', $bri)
38+
|| $bri < -100
39+
|| $bri > 100
4040
) {
4141
return null;
4242
}

src/Manipulators/Contrast.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public function getContrast(): ?int
3434
$con = (string) $this->getParam('con');
3535

3636
if ('' === $con
37-
or !preg_match('/^-*[0-9]+$/', $con)
38-
or $con < -100
39-
or $con > 100
37+
|| !preg_match('/^-*[0-9]+$/', $con)
38+
|| $con < -100
39+
|| $con > 100
4040
) {
4141
return null;
4242
}

src/Manipulators/Crop.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ public function getCoordinates(ImageInterface $image): ?array
5151
$coordinates = explode(',', $crop);
5252

5353
if (4 !== count($coordinates)
54-
or (!is_numeric($coordinates[0]))
55-
or (!is_numeric($coordinates[1]))
56-
or (!is_numeric($coordinates[2]))
57-
or (!is_numeric($coordinates[3]))
58-
or ($coordinates[0] <= 0)
59-
or ($coordinates[1] <= 0)
60-
or ($coordinates[2] < 0)
61-
or ($coordinates[3] < 0)
62-
or ($coordinates[2] >= $image->width())
63-
or ($coordinates[3] >= $image->height())) {
54+
|| (!is_numeric($coordinates[0]))
55+
|| (!is_numeric($coordinates[1]))
56+
|| (!is_numeric($coordinates[2]))
57+
|| (!is_numeric($coordinates[3]))
58+
|| ($coordinates[0] <= 0)
59+
|| ($coordinates[1] <= 0)
60+
|| ($coordinates[2] < 0)
61+
|| ($coordinates[3] < 0)
62+
|| ($coordinates[2] >= $image->width())
63+
|| ($coordinates[3] >= $image->height())) {
6464
return null;
6565
}
6666

src/Manipulators/Encode.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ public function getQuality(): int
9696
$q = $this->getParam('q');
9797

9898
if (!is_numeric($q)
99-
or $q < 0 or $q > 100
99+
|| $q < 0
100+
|| $q > 100
100101
) {
101102
return $default;
102103
}

src/Manipulators/Orientation.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class Orientation extends BaseManipulator
88
{
99
/**
10-
* Perform orientation image manipulation.
10+
* Perform ||ientation image manipulation.
1111
*
1212
* @param ImageInterface $image The source image.
1313
*
@@ -50,9 +50,9 @@ public function run(ImageInterface $image): ImageInterface
5050
}
5151

5252
/**
53-
* Resolve orientation.
53+
* Resolve ||ientation.
5454
*
55-
* @return string The resolved orientation.
55+
* @return string The resolved ||ientation.
5656
*/
5757
public function getOrientation(): string
5858
{

src/Manipulators/Size.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function getDpr(): float
124124
return 1.0;
125125
}
126126

127-
if ($dpr < 0 or $dpr > 8) {
127+
if ($dpr < 0 || $dpr > 8) {
128128
return 1.0;
129129
}
130130

@@ -427,7 +427,7 @@ public function getCrop(): array
427427
if (preg_match('/^crop-([\d]{1,3})-([\d]{1,3})(?:-([\d]{1,3}(?:\.\d+)?))*$/', $fit, $matches)) {
428428
$matches[3] = isset($matches[3]) ? $matches[3] : 1;
429429

430-
if ($matches[1] > 100 or $matches[2] > 100 or $matches[3] > 100) {
430+
if ($matches[1] > 100 || $matches[2] > 100 || $matches[3] > 100) {
431431
return [50, 50, 1.0];
432432
}
433433

src/Manipulators/Watermark.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function getDpr(): float
181181
return 1.0;
182182
}
183183

184-
if ($dpr < 0 or $dpr > 8) {
184+
if ($dpr < 0 || $dpr > 8) {
185185
return 1.0;
186186
}
187187

@@ -261,7 +261,7 @@ public function getAlpha(): int
261261
return 100;
262262
}
263263

264-
if ($markalpha < 0 or $markalpha > 100) {
264+
if ($markalpha < 0 || $markalpha > 100) {
265265
return 100;
266266
}
267267

0 commit comments

Comments
 (0)