From e8c5612b79fd8e74bec5823678958a8e92d9455e Mon Sep 17 00:00:00 2001 From: Ali Nawaz Date: Sun, 15 Nov 2026 03:01:13 +0500 Subject: [PATCH] Fix PHP 7.4+ and PHP 8.5 deprecation warnings --- src/Extractors/PhpCode.php | 4 ++-- src/Merge.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Extractors/PhpCode.php b/src/Extractors/PhpCode.php index 045f7fa9..caddbb26 100644 --- a/src/Extractors/PhpCode.php +++ b/src/Extractors/PhpCode.php @@ -127,9 +127,9 @@ function ($match) { case 'x': return chr(hexdec(substr($match[1], 1))); case 'u': - return static::unicodeChar(hexdec(substr($match[1], 1))); + return static::unicodeChar(hexdec(substr($match[1], 2, -1))); default: - return chr(octdec($match[1])); + return chr(octdec($match[1]) % 256); } }, $value diff --git a/src/Merge.php b/src/Merge.php index 43a309bb..dd4d2817 100644 --- a/src/Merge.php +++ b/src/Merge.php @@ -121,7 +121,7 @@ public static function mergeReferences(Translation $from, Translation $to, $opti */ public static function mergeTranslation(Translation $from, Translation $to, $options = self::DEFAULTS) { - $override = (boolean) ($options & self::TRANSLATION_OVERRIDE); + $override = (bool) ($options & self::TRANSLATION_OVERRIDE); if (!$to->hasTranslation() || ($from->hasTranslation() && $override)) { $to->setTranslation($from->getTranslation());