From 4f22b099b300f1df469d947989c055ca2c89f854 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 29 Jun 2021 12:13:16 +0200 Subject: [PATCH] [Routing] add missing types --- src/Symfony/Component/Routing/Loader/ClosureLoader.php | 2 +- .../Component/Routing/Loader/Configurator/RouteConfigurator.php | 2 +- src/Symfony/Component/Routing/Loader/ContainerLoader.php | 2 +- .../Routing/Matcher/Dumper/CompiledUrlMatcherDumper.php | 2 +- src/Symfony/Component/Routing/Route.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Routing/Loader/ClosureLoader.php b/src/Symfony/Component/Routing/Loader/ClosureLoader.php index 320cdc4d8d5d9..631d8888af474 100644 --- a/src/Symfony/Component/Routing/Loader/ClosureLoader.php +++ b/src/Symfony/Component/Routing/Loader/ClosureLoader.php @@ -36,7 +36,7 @@ public function load(mixed $closure, string $type = null) /** * {@inheritdoc} */ - public function supports($resource, string $type = null) + public function supports(mixed $resource, string $type = null) { return $resource instanceof \Closure && (!$type || 'closure' === $type); } diff --git a/src/Symfony/Component/Routing/Loader/Configurator/RouteConfigurator.php b/src/Symfony/Component/Routing/Loader/Configurator/RouteConfigurator.php index abbdeae4d05a8..05bf955ea93c0 100644 --- a/src/Symfony/Component/Routing/Loader/Configurator/RouteConfigurator.php +++ b/src/Symfony/Component/Routing/Loader/Configurator/RouteConfigurator.php @@ -24,7 +24,7 @@ class RouteConfigurator protected $parentConfigurator; - public function __construct(RouteCollection $collection, $route, string $name = '', CollectionConfigurator $parentConfigurator = null, array $prefixes = null) + public function __construct(RouteCollection $collection, RouteCollection $route, string $name = '', CollectionConfigurator $parentConfigurator = null, array $prefixes = null) { $this->collection = $collection; $this->route = $route; diff --git a/src/Symfony/Component/Routing/Loader/ContainerLoader.php b/src/Symfony/Component/Routing/Loader/ContainerLoader.php index d8730aec61479..2f2511f4e75f8 100644 --- a/src/Symfony/Component/Routing/Loader/ContainerLoader.php +++ b/src/Symfony/Component/Routing/Loader/ContainerLoader.php @@ -31,7 +31,7 @@ public function __construct(ContainerInterface $container, string $env = null) /** * {@inheritdoc} */ - public function supports($resource, string $type = null) + public function supports(mixed $resource, string $type = null) { return 'service' === $type && \is_string($resource); } diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/CompiledUrlMatcherDumper.php b/src/Symfony/Component/Routing/Matcher/Dumper/CompiledUrlMatcherDumper.php index bd785240960a3..90491b9203868 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/CompiledUrlMatcherDumper.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/CompiledUrlMatcherDumper.php @@ -463,7 +463,7 @@ private function indent(string $code, int $level = 1): string /** * @internal */ - public static function export($value): string + public static function export(mixed $value): string { if (null === $value) { return 'null'; diff --git a/src/Symfony/Component/Routing/Route.php b/src/Symfony/Component/Routing/Route.php index 3f783ce929bbc..b67e9bc14d0c4 100644 --- a/src/Symfony/Component/Routing/Route.php +++ b/src/Symfony/Component/Routing/Route.php @@ -50,7 +50,7 @@ class Route implements \Serializable * @param string|string[] $methods A required HTTP method or an array of restricted methods * @param string|null $condition A condition that should evaluate to true for the route to match */ - public function __construct(string $path, array $defaults = [], array $requirements = [], array $options = [], ?string $host = '', $schemes = [], $methods = [], ?string $condition = '') + public function __construct(string $path, array $defaults = [], array $requirements = [], array $options = [], ?string $host = '', string|array $schemes = [], string|array $methods = [], ?string $condition = '') { $this->setPath($path); $this->addDefaults($defaults);