1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-20 12:41:23 +02:00

Throw exceptions if resizer receives unvalid values

This commit is contained in:
Oliver Vogel
2024-01-02 13:03:44 +01:00
parent 66b2895238
commit ec1fead71f

View File

@@ -12,7 +12,17 @@ class RectangleResizer
protected ?int $width = null, protected ?int $width = null,
protected ?int $height = null, protected ?int $height = null,
) { ) {
// if (is_int($width) && $width < 1) {
throw new GeometryException(
'The width you specify must be greater than or equal to 1.'
);
}
if (is_int($height) && $height < 1) {
throw new GeometryException(
'The height you specify must be greater than or equal to 1.'
);
}
} }
public static function to(...$arguments): self public static function to(...$arguments): self