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());