Skip to content

Commit e338796

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Add Tagalog translations for validator messages 94, 95, 96 and 99 PHPUnit's assertContains() performs strict comparisons now. [ClassLoader][Routing] Fix namespace parsing on php 8. Fix deprecated libxml_disable_entity_loader Made reference to PHPUnit\Util\XML::loadfile php5-compatible. [Validator] Add missing translations for german and vietnamese Modernized deprecated PHPUnit assertion calls [Console] The message of "class not found" errors has changed in php 8. The PHPUnit\Util\XML class has been removed in PHPUnit 9.3. [Console] Make sure we pass a numeric array of arguments to call_user_func_array(). [Serializer] Fix that it will never reach DOMNode [Validator] sync translations [VarDumper] Improve previous fix on light array coloration [Cache] Fix #37667
2 parents e103381 + 0614c9e commit e338796

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Loader/AnnotationFileLoader.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ protected function findClass($file)
9595
throw new \InvalidArgumentException(sprintf('The file "%s" does not contain PHP code. Did you forgot to add the "<?php" start tag at the beginning of the file?', $file));
9696
}
9797

98+
$nsTokens = [T_NS_SEPARATOR => true, T_STRING => true];
99+
if (\defined('T_NAME_QUALIFIED')) {
100+
$nsTokens[T_NAME_QUALIFIED] = true;
101+
}
102+
98103
for ($i = 0; isset($tokens[$i]); ++$i) {
99104
$token = $tokens[$i];
100105

@@ -106,9 +111,9 @@ protected function findClass($file)
106111
return $namespace.'\\'.$token[1];
107112
}
108113

109-
if (true === $namespace && T_STRING === $token[0]) {
114+
if (true === $namespace && isset($nsTokens[$token[0]])) {
110115
$namespace = $token[1];
111-
while (isset($tokens[++$i][1]) && \in_array($tokens[$i][0], [T_NS_SEPARATOR, T_STRING])) {
116+
while (isset($tokens[++$i][1], $nsTokens[$tokens[$i][0]])) {
112117
$namespace .= $tokens[$i][1];
113118
}
114119
$token = $tokens[$i];

0 commit comments

Comments
 (0)