Skip to content

Commit

Permalink
Replace operator "or" with "||"
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jan 29, 2024
1 parent 6b2a329 commit 8bb08fb
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/Manipulators/Blur.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public function getBlur(): ?int
$blur = $this->getParam('blur');

if (!is_numeric($blur)
or $blur < 0
or $blur > 100
|| $blur < 0
|| $blur > 100
) {
return null;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Manipulators/Brightness.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public function getBrightness(): ?int
$bri = (string) $this->getParam('bri');

if ('' === $bri
or !preg_match('/^-*[0-9]+$/', $bri)
or $bri < -100
or $bri > 100
|| !preg_match('/^-*[0-9]+$/', $bri)
|| $bri < -100
|| $bri > 100
) {
return null;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Manipulators/Contrast.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public function getContrast(): ?int
$con = (string) $this->getParam('con');

if ('' === $con
or !preg_match('/^-*[0-9]+$/', $con)
or $con < -100
or $con > 100
|| !preg_match('/^-*[0-9]+$/', $con)
|| $con < -100
|| $con > 100
) {
return null;
}
Expand Down
20 changes: 10 additions & 10 deletions src/Manipulators/Crop.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ public function getCoordinates(ImageInterface $image): ?array
$coordinates = explode(',', $crop);

if (4 !== count($coordinates)
or (!is_numeric($coordinates[0]))
or (!is_numeric($coordinates[1]))
or (!is_numeric($coordinates[2]))
or (!is_numeric($coordinates[3]))
or ($coordinates[0] <= 0)
or ($coordinates[1] <= 0)
or ($coordinates[2] < 0)
or ($coordinates[3] < 0)
or ($coordinates[2] >= $image->width())
or ($coordinates[3] >= $image->height())) {
|| (!is_numeric($coordinates[0]))
|| (!is_numeric($coordinates[1]))
|| (!is_numeric($coordinates[2]))
|| (!is_numeric($coordinates[3]))
|| ($coordinates[0] <= 0)
|| ($coordinates[1] <= 0)
|| ($coordinates[2] < 0)
|| ($coordinates[3] < 0)
|| ($coordinates[2] >= $image->width())
|| ($coordinates[3] >= $image->height())) {
return null;
}

Expand Down
3 changes: 2 additions & 1 deletion src/Manipulators/Encode.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public function getQuality(): int
$q = $this->getParam('q');

if (!is_numeric($q)
or $q < 0 or $q > 100
|| $q < 0
|| $q > 100
) {
return $default;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Manipulators/Orientation.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Orientation extends BaseManipulator
{
/**
* Perform orientation image manipulation.
* Perform ||ientation image manipulation.

This comment has been minimized.

Copy link
@Art4

Art4 Jan 29, 2024

😅

*
* @param ImageInterface $image The source image.
*
Expand Down Expand Up @@ -50,9 +50,9 @@ public function run(ImageInterface $image): ImageInterface
}

/**
* Resolve orientation.
* Resolve ||ientation.

This comment has been minimized.

Copy link
@Art4

Art4 Jan 29, 2024

r/||ientation/orientation

*
* @return string The resolved orientation.
* @return string The resolved ||ientation.
*/
public function getOrientation(): string
{
Expand Down
4 changes: 2 additions & 2 deletions src/Manipulators/Size.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function getDpr(): float
return 1.0;
}

if ($dpr < 0 or $dpr > 8) {
if ($dpr < 0 || $dpr > 8) {
return 1.0;
}

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

if ($matches[1] > 100 or $matches[2] > 100 or $matches[3] > 100) {
if ($matches[1] > 100 || $matches[2] > 100 || $matches[3] > 100) {
return [50, 50, 1.0];
}

Expand Down
4 changes: 2 additions & 2 deletions src/Manipulators/Watermark.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function getDpr(): float
return 1.0;
}

if ($dpr < 0 or $dpr > 8) {
if ($dpr < 0 || $dpr > 8) {
return 1.0;
}

Expand Down Expand Up @@ -261,7 +261,7 @@ public function getAlpha(): int
return 100;
}

if ($markalpha < 0 or $markalpha > 100) {
if ($markalpha < 0 || $markalpha > 100) {
return 100;
}

Expand Down

0 comments on commit 8bb08fb

Please sign in to comment.