1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-24 14:32:52 +02:00

Remove not necessary parentheses

This commit is contained in:
Oliver Vogel
2024-01-30 19:42:03 +01:00
parent 4ffce71364
commit f6f0e24958
7 changed files with 18 additions and 18 deletions

View File

@@ -75,7 +75,7 @@ class Colorspace implements ColorspaceInterface
// add to each value
$values = array_map(function ($value) use ($color, $chroma) {
return $value + ($color->value()->normalize() - $chroma);
return $value + $color->value()->normalize() - $chroma;
}, $values);
array_push($values, 1); // append alpha channel value

View File

@@ -44,8 +44,8 @@ class CropModifier extends DriverSpecialized implements ModifierInterface
$modified = Cloner::cloneEmpty($frame->native(), $resizeTo);
// define offset
$offset_x = ($resizeTo->pivot()->x() + $this->offset_x);
$offset_y = ($resizeTo->pivot()->y() + $this->offset_y);
$offset_x = $resizeTo->pivot()->x() + $this->offset_x;
$offset_y = $resizeTo->pivot()->y() + $this->offset_y;
// define target width & height
$targetWidth = min($resizeTo->width(), $originalSize->width());

View File

@@ -28,8 +28,8 @@ class PixelateModifier extends DriverSpecialized implements ModifierInterface
$size = $frame->size();
$frame->native()->scaleImage(
(int) round(max(1, ($size->width() / $this->size))),
(int) round(max(1, ($size->height() / $this->size)))
(int) round(max(1, $size->width() / $this->size)),
(int) round(max(1, $size->height() / $this->size))
);
$frame->native()->scaleImage($size->width(), $size->height());

View File

@@ -28,7 +28,7 @@ class PlaceModifier extends DriverSpecialized implements ModifierInterface
if ($this->opacity < 100) {
$watermark->core()->native()->evaluateImage(
Imagick::EVALUATE_DIVIDE,
$this->opacity > 0 ? (100 / $this->opacity) : 1000,
$this->opacity > 0 ? 100 / $this->opacity : 1000,
Imagick::CHANNEL_ALPHA,
);
}

View File

@@ -207,7 +207,7 @@ class Polygon implements IteratorAggregate, Countable, ArrayAccess, DrawableInte
if ($a->x() === $b->x()) {
return 0;
}
return ($a->x() < $b->x()) ? -1 : 1;
return $a->x() < $b->x() ? -1 : 1;
});
return $points[0];
@@ -229,7 +229,7 @@ class Polygon implements IteratorAggregate, Countable, ArrayAccess, DrawableInte
if ($a->x() === $b->x()) {
return 0;
}
return ($a->x() > $b->x()) ? -1 : 1;
return $a->x() > $b->x() ? -1 : 1;
});
return $points[0];
@@ -251,7 +251,7 @@ class Polygon implements IteratorAggregate, Countable, ArrayAccess, DrawableInte
if ($a->y() === $b->y()) {
return 0;
}
return ($a->y() > $b->y()) ? -1 : 1;
return $a->y() > $b->y() ? -1 : 1;
});
return $points[0];
@@ -273,7 +273,7 @@ class Polygon implements IteratorAggregate, Countable, ArrayAccess, DrawableInte
if ($a->y() === $b->y()) {
return 0;
}
return ($a->y() < $b->y()) ? -1 : 1;
return $a->y() < $b->y() ? -1 : 1;
});
return $points[0];
@@ -303,16 +303,16 @@ class Polygon implements IteratorAggregate, Countable, ArrayAccess, DrawableInte
switch (strtolower($position)) {
case 'center':
case 'middle':
$diff = ($this->centerPoint()->x() - $this->pivot()->x());
$diff = $this->centerPoint()->x() - $this->pivot()->x();
break;
case 'right':
$diff = ($this->mostRightPoint()->x() - $this->pivot()->x());
$diff = $this->mostRightPoint()->x() - $this->pivot()->x();
break;
default:
case 'left':
$diff = ($this->mostLeftPoint()->x() - $this->pivot()->x());
$diff = $this->mostLeftPoint()->x() - $this->pivot()->x();
break;
}
@@ -336,16 +336,16 @@ class Polygon implements IteratorAggregate, Countable, ArrayAccess, DrawableInte
switch (strtolower($position)) {
case 'center':
case 'middle':
$diff = ($this->centerPoint()->y() - $this->pivot()->y());
$diff = $this->centerPoint()->y() - $this->pivot()->y();
break;
case 'top':
$diff = ($this->mostTopPoint()->y() - $this->pivot()->y()) - $this->height();
$diff = $this->mostTopPoint()->y() - $this->pivot()->y() - $this->height();
break;
default:
case 'bottom':
$diff = ($this->mostBottomPoint()->y() - $this->pivot()->y()) + $this->height();
$diff = $this->mostBottomPoint()->y() - $this->pivot()->y() + $this->height();
break;
}

View File

@@ -772,7 +772,7 @@ final class Image implements ImageInterface
return $this->modify(
new FillModifier(
$color,
(is_null($x) || is_null($y)) ? null : new Point($x, $y),
is_null($x) || is_null($y) ? null : new Point($x, $y),
),
);
}

View File

@@ -52,7 +52,7 @@ class TextBlock extends Collection
if (mb_strlen((string) $a) === mb_strlen((string) $b)) {
return 0;
}
return (mb_strlen((string) $a) > mb_strlen((string) $b)) ? -1 : 1;
return mb_strlen((string) $a) > mb_strlen((string) $b) ? -1 : 1;
});
return $lines[0];