Skip to content

Commit bdd0299

Browse files
acrobatdbu
authored andcommitted
Revert changes in chainrouter and deprecate interface
1 parent ca9ee0c commit bdd0299

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

src/ChainRouter.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -231,19 +231,8 @@ public function generate($name, $parameters = [], $absolute = UrlGeneratorInterf
231231
continue;
232232
}
233233

234-
// if $router does not announce it is capable of handling
235-
// non-string routes and the ROUTE_OBJECT is set in the parameters array, continue
236-
if (array_key_exists(RouteObjectInterface::ROUTE_OBJECT, $parameters) && is_object($parameters[RouteObjectInterface::ROUTE_OBJECT]) && !$router instanceof VersatileGeneratorInterface) {
237-
continue;
238-
}
239-
240-
$routeName = $name;
241-
if (RouteObjectInterface::OBJECT_BASED_ROUTE_NAME === $name && array_key_exists(RouteObjectInterface::ROUTE_OBJECT, $parameters) && is_object($parameters[RouteObjectInterface::ROUTE_OBJECT])) {
242-
$routeName = $parameters[RouteObjectInterface::ROUTE_OBJECT];
243-
}
244-
245234
// If $router is versatile and doesn't support this route name, continue
246-
if ($router instanceof VersatileGeneratorInterface && !$router->supports($routeName)) {
235+
if ($router instanceof VersatileGeneratorInterface && !$router->supports($name)) {
247236
continue;
248237
}
249238

src/VersatileGeneratorInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
/**
1717
* This generator is able to handle more than string route names as symfony
1818
* core supports them.
19+
*
20+
* @deprecated The "Symfony\Cmf\Component\Routing\VersatileGeneratorInterface" is deprecated in symfony-cmf/Routing v2.3 and will be removed in symfony-cmf/Routing v3.O. Use the "_route_object" parameter instead to handle route objects
1921
*/
2022
interface VersatileGeneratorInterface extends UrlGeneratorInterface
2123
{

0 commit comments

Comments
 (0)