This commit is contained in:
2025-05-12 14:25:25 +02:00
parent ab2db755ef
commit 9e378ca2b7
2719 changed files with 46505 additions and 60181 deletions

View File

@@ -41,7 +41,7 @@ class YamlFileLoader extends FileLoader
/**
* @throws \InvalidArgumentException When a route can't be parsed because YAML is invalid
*/
public function load(mixed $file, string $type = null): RouteCollection
public function load(mixed $file, ?string $type = null): RouteCollection
{
$path = $this->locator->locate($file);
@@ -105,7 +105,7 @@ class YamlFileLoader extends FileLoader
return $collection;
}
public function supports(mixed $resource, string $type = null): bool
public function supports(mixed $resource, ?string $type = null): bool
{
return \is_string($resource) && \in_array(pathinfo($resource, \PATHINFO_EXTENSION), ['yml', 'yaml'], true) && (!$type || 'yaml' === $type);
}
@@ -157,7 +157,7 @@ class YamlFileLoader extends FileLoader
$defaults['_stateless'] = $config['stateless'];
}
$routes = $this->createLocalizedRoute($collection, $name, $config['path']);
$routes = $this->createLocalizedRoute(new RouteCollection(), $name, $config['path']);
$routes->addDefaults($defaults);
$routes->addRequirements($requirements);
$routes->addOptions($options);
@@ -168,6 +168,8 @@ class YamlFileLoader extends FileLoader
if (isset($config['host'])) {
$this->addHost($routes, $config['host']);
}
$collection->addCollection($routes);
}
/**