From 6a5313d784c76e764840774dc13f6c78e8c29502 Mon Sep 17 00:00:00 2001 From: Tea Lover Date: Mon, 20 Feb 2023 09:22:00 +0100 Subject: [PATCH] PHP-8 implicit conversion deprecation fix --- src/Gregwar/Captcha/CaptchaBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Gregwar/Captcha/CaptchaBuilder.php b/src/Gregwar/Captcha/CaptchaBuilder.php index 8dbbd61..fcba934 100644 --- a/src/Gregwar/Captcha/CaptchaBuilder.php +++ b/src/Gregwar/Captcha/CaptchaBuilder.php @@ -345,8 +345,8 @@ protected function writePhrase($image, $phrase, $font, $width, $height) $box = \imagettfbbox($size, 0, $font, $phrase); $textWidth = $box[2] - $box[0]; $textHeight = $box[1] - $box[7]; - $x = ($width - $textWidth) / 2; - $y = ($height - $textHeight) / 2 + $size; + $x = (int)(($width - $textWidth) / 2); + $y = (int)(($height - $textHeight) / 2 + $size); if (!$this->textColor) { $textColor = array($this->rand(0, 150), $this->rand(0, 150), $this->rand(0, 150));