updated composer
This commit is contained in:
@@ -95,12 +95,10 @@ class AnnotationFileLoader extends FileLoader
|
||||
|
||||
$nsTokens = [\T_NS_SEPARATOR => true, \T_STRING => true];
|
||||
if (\defined('T_NAME_QUALIFIED')) {
|
||||
$nsTokens[T_NAME_QUALIFIED] = true;
|
||||
$nsTokens[\T_NAME_QUALIFIED] = true;
|
||||
}
|
||||
|
||||
for ($i = 0; isset($tokens[$i]); ++$i) {
|
||||
$token = $tokens[$i];
|
||||
|
||||
if (!isset($token[1])) {
|
||||
continue;
|
||||
}
|
||||
@@ -122,6 +120,9 @@ class AnnotationFileLoader extends FileLoader
|
||||
$skipClassToken = false;
|
||||
for ($j = $i - 1; $j > 0; --$j) {
|
||||
if (!isset($tokens[$j][1])) {
|
||||
if ('(' === $tokens[$j] || ',' === $tokens[$j]) {
|
||||
$skipClassToken = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,16 @@ class CollectionConfigurator
|
||||
$this->parentPrefixes = $parentPrefixes;
|
||||
}
|
||||
|
||||
public function __sleep()
|
||||
{
|
||||
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
|
||||
}
|
||||
|
||||
public function __wakeup()
|
||||
{
|
||||
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
if (null === $this->prefixes) {
|
||||
|
||||
@@ -30,6 +30,16 @@ class ImportConfigurator
|
||||
$this->route = $route;
|
||||
}
|
||||
|
||||
public function __sleep()
|
||||
{
|
||||
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
|
||||
}
|
||||
|
||||
public function __wakeup()
|
||||
{
|
||||
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->parent->addCollection($this->route);
|
||||
|
||||
@@ -358,7 +358,7 @@ class XmlFileLoader extends FileLoader
|
||||
/**
|
||||
* Recursively parses the value of a "default" element.
|
||||
*
|
||||
* @return array|bool|float|int|string The parsed value
|
||||
* @return array|bool|float|int|string|null The parsed value
|
||||
*
|
||||
* @throws \InvalidArgumentException when the XML is invalid
|
||||
*/
|
||||
|
||||
30
vendor/symfony/routing/Loader/YamlFileLoader.php
vendored
30
vendor/symfony/routing/Loader/YamlFileLoader.php
vendored
@@ -33,7 +33,7 @@ class YamlFileLoader extends FileLoader
|
||||
use LocalizedRouteTrait;
|
||||
use PrefixTrait;
|
||||
|
||||
private static $availableKeys = [
|
||||
private const AVAILABLE_KEYS = [
|
||||
'resource', 'type', 'prefix', 'path', 'host', 'schemes', 'methods', 'defaults', 'requirements', 'options', 'condition', 'controller', 'name_prefix', 'trailing_slash_on_root', 'locale', 'format', 'utf8', 'exclude', 'stateless',
|
||||
];
|
||||
private $yamlParser;
|
||||
@@ -113,9 +113,9 @@ class YamlFileLoader extends FileLoader
|
||||
*/
|
||||
protected function parseRoute(RouteCollection $collection, string $name, array $config, string $path)
|
||||
{
|
||||
$defaults = isset($config['defaults']) ? $config['defaults'] : [];
|
||||
$requirements = isset($config['requirements']) ? $config['requirements'] : [];
|
||||
$options = isset($config['options']) ? $config['options'] : [];
|
||||
$defaults = $config['defaults'] ?? [];
|
||||
$requirements = $config['requirements'] ?? [];
|
||||
$options = $config['options'] ?? [];
|
||||
|
||||
foreach ($requirements as $placeholder => $requirement) {
|
||||
if (\is_int($placeholder)) {
|
||||
@@ -161,15 +161,15 @@ class YamlFileLoader extends FileLoader
|
||||
*/
|
||||
protected function parseImport(RouteCollection $collection, array $config, string $path, string $file)
|
||||
{
|
||||
$type = isset($config['type']) ? $config['type'] : null;
|
||||
$prefix = isset($config['prefix']) ? $config['prefix'] : '';
|
||||
$defaults = isset($config['defaults']) ? $config['defaults'] : [];
|
||||
$requirements = isset($config['requirements']) ? $config['requirements'] : [];
|
||||
$options = isset($config['options']) ? $config['options'] : [];
|
||||
$host = isset($config['host']) ? $config['host'] : null;
|
||||
$condition = isset($config['condition']) ? $config['condition'] : null;
|
||||
$schemes = isset($config['schemes']) ? $config['schemes'] : null;
|
||||
$methods = isset($config['methods']) ? $config['methods'] : null;
|
||||
$type = $config['type'] ?? null;
|
||||
$prefix = $config['prefix'] ?? '';
|
||||
$defaults = $config['defaults'] ?? [];
|
||||
$requirements = $config['requirements'] ?? [];
|
||||
$options = $config['options'] ?? [];
|
||||
$host = $config['host'] ?? null;
|
||||
$condition = $config['condition'] ?? null;
|
||||
$schemes = $config['schemes'] ?? null;
|
||||
$methods = $config['methods'] ?? null;
|
||||
$trailingSlashOnRoot = $config['trailing_slash_on_root'] ?? true;
|
||||
$namePrefix = $config['name_prefix'] ?? null;
|
||||
$exclude = $config['exclude'] ?? null;
|
||||
@@ -240,8 +240,8 @@ class YamlFileLoader extends FileLoader
|
||||
if (!\is_array($config)) {
|
||||
throw new \InvalidArgumentException(sprintf('The definition of "%s" in "%s" must be a YAML array.', $name, $path));
|
||||
}
|
||||
if ($extraKeys = array_diff(array_keys($config), self::$availableKeys)) {
|
||||
throw new \InvalidArgumentException(sprintf('The routing file "%s" contains unsupported keys for "%s": "%s". Expected one of: "%s".', $path, $name, implode('", "', $extraKeys), implode('", "', self::$availableKeys)));
|
||||
if ($extraKeys = array_diff(array_keys($config), self::AVAILABLE_KEYS)) {
|
||||
throw new \InvalidArgumentException(sprintf('The routing file "%s" contains unsupported keys for "%s": "%s". Expected one of: "%s".', $path, $name, implode('", "', $extraKeys), implode('", "', self::AVAILABLE_KEYS)));
|
||||
}
|
||||
if (isset($config['resource']) && isset($config['path'])) {
|
||||
throw new \InvalidArgumentException(sprintf('The routing file "%s" must not specify both the "resource" key and the "path" key for "%s". Choose between an import and a route definition.', $path, $name));
|
||||
|
||||
Reference in New Issue
Block a user