diff --git a/CHANGELOG.md b/CHANGELOG.md index b532a2e..6c9034b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========= +3.0.3 (unreleased) +------------------ + +* Fix regression: Any kind of iterable can be used with the ContentAwareGenerator + 3.0.2 ----- diff --git a/src/ContentAwareGenerator.php b/src/ContentAwareGenerator.php index d2e4922..3d4e424 100644 --- a/src/ContentAwareGenerator.php +++ b/src/ContentAwareGenerator.php @@ -15,7 +15,6 @@ use Symfony\Component\Routing\Exception\RouteNotFoundException; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Routing\Route as SymfonyRoute; -use Symfony\Component\Routing\RouteCollection; /** * A generator that tries to generate routes from object, route names or @@ -182,11 +181,11 @@ private function getRouteByContent(string $name, array &$parameters): SymfonyRou } /** - * @param RouteCollection|SymfonyRoute[] $routes + * @param iterable $routes * * @return bool|SymfonyRoute false if no route requirement matches the provided locale */ - private function getRouteByLocale(RouteCollection|array $routes, ?string $locale): bool|SymfonyRoute + private function getRouteByLocale(iterable $routes, ?string $locale): bool|SymfonyRoute { foreach ($routes as $route) { if (!$route instanceof SymfonyRoute) { diff --git a/src/RouteReferrersReadInterface.php b/src/RouteReferrersReadInterface.php index c505e43..620835c 100644 --- a/src/RouteReferrersReadInterface.php +++ b/src/RouteReferrersReadInterface.php @@ -22,7 +22,7 @@ interface RouteReferrersReadInterface /** * Get the routes that point to this content. * - * @return Route[] Route instances that point to this content + * @return iterable Route instances that point to this content */ public function getRoutes(): iterable; }