Skip to content

Commit 67a26c9

Browse files
committed
Handle PHP 8 T_NAME_FULLY_QUALIFIED like PHP 7.
See following issues for more details: - #284 - wp-cli/i18n-command#344
1 parent cbf1101 commit 67a26c9

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/Utils/PhpFunctionsScanner.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ public function getFunctions(array $constants = [])
9090
continue;
9191
}
9292

93+
if (defined('T_NAME_FULLY_QUALIFIED') && T_NAME_FULLY_QUALIFIED === $value[0]) {
94+
$value[0] = T_STRING;
95+
$value[1] = ltrim($value[1], '\\');
96+
}
97+
9398
switch ($value[0]) {
9499
case T_CONSTANT_ENCAPSED_STRING:
95100
//add an argument to the current function

0 commit comments

Comments
 (0)