composer update

This commit is contained in:
2020-12-06 10:28:55 +00:00
parent 69d92960d9
commit 09413522bb
1596 changed files with 60456 additions and 39587 deletions

View File

@@ -75,7 +75,7 @@ class AnnotationFileLoader extends FileLoader
*/
public function supports($resource, $type = null)
{
return \is_string($resource) && 'php' === pathinfo($resource, PATHINFO_EXTENSION) && (!$type || 'annotation' === $type);
return \is_string($resource) && 'php' === pathinfo($resource, \PATHINFO_EXTENSION) && (!$type || 'annotation' === $type);
}
/**
@@ -91,10 +91,15 @@ class AnnotationFileLoader extends FileLoader
$namespace = false;
$tokens = token_get_all(file_get_contents($file));
if (1 === \count($tokens) && T_INLINE_HTML === $tokens[0][0]) {
if (1 === \count($tokens) && \T_INLINE_HTML === $tokens[0][0]) {
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));
}
$nsTokens = [\T_NS_SEPARATOR => true, \T_STRING => true];
if (\defined('T_NAME_QUALIFIED')) {
$nsTokens[T_NAME_QUALIFIED] = true;
}
for ($i = 0; isset($tokens[$i]); ++$i) {
$token = $tokens[$i];
@@ -102,19 +107,19 @@ class AnnotationFileLoader extends FileLoader
continue;
}
if (true === $class && T_STRING === $token[0]) {
if (true === $class && \T_STRING === $token[0]) {
return $namespace.'\\'.$token[1];
}
if (true === $namespace && T_STRING === $token[0]) {
if (true === $namespace && isset($nsTokens[$token[0]])) {
$namespace = $token[1];
while (isset($tokens[++$i][1]) && \in_array($tokens[$i][0], [T_NS_SEPARATOR, T_STRING])) {
while (isset($tokens[++$i][1], $nsTokens[$tokens[$i][0]])) {
$namespace .= $tokens[$i][1];
}
$token = $tokens[$i];
}
if (T_CLASS === $token[0]) {
if (\T_CLASS === $token[0]) {
// Skip usage of ::class constant and anonymous classes
$skipClassToken = false;
for ($j = $i - 1; $j > 0; --$j) {
@@ -122,10 +127,10 @@ class AnnotationFileLoader extends FileLoader
break;
}
if (T_DOUBLE_COLON === $tokens[$j][0] || T_NEW === $tokens[$j][0]) {
if (\T_DOUBLE_COLON === $tokens[$j][0] || \T_NEW === $tokens[$j][0]) {
$skipClassToken = true;
break;
} elseif (!\in_array($tokens[$j][0], [T_WHITESPACE, T_DOC_COMMENT, T_COMMENT])) {
} elseif (!\in_array($tokens[$j][0], [\T_WHITESPACE, \T_DOC_COMMENT, \T_COMMENT])) {
break;
}
}
@@ -135,7 +140,7 @@ class AnnotationFileLoader extends FileLoader
}
}
if (T_NAMESPACE === $token[0]) {
if (\T_NAMESPACE === $token[0]) {
$namespace = true;
}
}