Mercurial > hg > isophonics-drupal-site
diff vendor/symfony/routing/Loader/AnnotationFileLoader.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children | af1871eacc83 |
line wrap: on
line diff
--- a/vendor/symfony/routing/Loader/AnnotationFileLoader.php Tue Jul 10 15:07:59 2018 +0100 +++ b/vendor/symfony/routing/Loader/AnnotationFileLoader.php Thu Feb 28 13:21:36 2019 +0000 @@ -11,10 +11,10 @@ namespace Symfony\Component\Routing\Loader; +use Symfony\Component\Config\FileLocatorInterface; +use Symfony\Component\Config\Loader\FileLoader; +use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\Routing\RouteCollection; -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Config\Loader\FileLoader; -use Symfony\Component\Config\FileLocatorInterface; /** * AnnotationFileLoader loads routing information from annotations set @@ -31,7 +31,7 @@ */ public function __construct(FileLocatorInterface $locator, AnnotationClassLoader $loader) { - if (!function_exists('token_get_all')) { + if (!\function_exists('token_get_all')) { throw new \RuntimeException('The Tokenizer extension is required for the routing annotation loaders.'); } @@ -72,7 +72,7 @@ */ 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); } /** @@ -88,7 +88,7 @@ $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)); } @@ -105,7 +105,7 @@ if (true === $namespace && T_STRING === $token[0]) { $namespace = $token[1]; - while (isset($tokens[++$i][1]) && in_array($tokens[$i][0], array(T_NS_SEPARATOR, T_STRING))) { + while (isset($tokens[++$i][1]) && \in_array($tokens[$i][0], [T_NS_SEPARATOR, T_STRING])) { $namespace .= $tokens[$i][1]; } $token = $tokens[$i]; @@ -122,7 +122,7 @@ if (T_DOUBLE_COLON === $tokens[$j][0] || T_NEW === $tokens[$j][0]) { $skipClassToken = true; break; - } elseif (!in_array($tokens[$j][0], array(T_WHITESPACE, T_DOC_COMMENT, T_COMMENT))) { + } elseif (!\in_array($tokens[$j][0], [T_WHITESPACE, T_DOC_COMMENT, T_COMMENT])) { break; } }