From 44685eceba6667a45799ab1f3805bd53f3372e8a Mon Sep 17 00:00:00 2001 From: Garion Herman Date: Sat, 5 Sep 2020 11:13:09 +1200 Subject: [PATCH] FIX Support PHP 8 namespace tokens in i18nTextCollector --- src/i18n/TextCollection/i18nTextCollector.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/i18n/TextCollection/i18nTextCollector.php b/src/i18n/TextCollection/i18nTextCollector.php index 843412dd5..5d3445f7a 100644 --- a/src/i18n/TextCollection/i18nTextCollector.php +++ b/src/i18n/TextCollection/i18nTextCollector.php @@ -570,6 +570,13 @@ class i18nTextCollector if (is_array($token)) { list($id, $text) = $token; + // PHP 8 namespace tokens + if (\defined('T_NAME_QUALIFIED') && in_array($id, [T_NAME_FULLY_QUALIFIED, T_NAME_QUALIFIED])) { + $inNamespace = true; + $currentClass[] = $text; + continue; + } + // Check class if ($id === T_NAMESPACE) { $inNamespace = true;