From 1ee35c837cf5b1bc570a9194c5d60b6516b97e94 Mon Sep 17 00:00:00 2001 From: suve Date: Sat, 27 Jan 2024 23:22:45 +0100 Subject: [PATCH] Fix compatibility with PHP 8.3.0 The imagerotate() function used to take 3 parameters. Then, in PHP 5.1.0, an optional fourth parameter was added. And now, in PHP 8.3.0, that parameter has been removed. Since the code in GdAdapter always explicitly provides the fourth parameter when calling the function, this causes it to fail with an ArgumentCountError under PHP 8.3.0. This commit removes the unused fourth parameter from all call sites. --- src/GdAdapter.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GdAdapter.php b/src/GdAdapter.php index ad04053..af52656 100644 --- a/src/GdAdapter.php +++ b/src/GdAdapter.php @@ -90,13 +90,13 @@ public function rotate($orientation) // rotate if (in_array($orientation, [3, 4])) { - $image = imagerotate($this->image, 180, $transparency, 1); + $image = imagerotate($this->image, 180, $transparency); } if (in_array($orientation, [5, 6])) { - $image = imagerotate($this->image, -90, $transparency, 1); + $image = imagerotate($this->image, -90, $transparency); list($this->width, $this->height) = [$this->height, $this->width]; } elseif (in_array($orientation, [7, 8])) { - $image = imagerotate($this->image, 90, $transparency, 1); + $image = imagerotate($this->image, 90, $transparency); list($this->width, $this->height) = [$this->height, $this->width]; } /** @var resource $image is now defined */