Only allow route names, deprecate support for route objects in UrlGenerator methods

Created on 11 June 2020, over 4 years ago
Updated 17 February 2023, almost 2 years ago

Problem/Motivation

Following #2917331: Decouple from Symfony CMF β†’ we can simplify the implementation of, and reduce the API surface of, methods in UrlGenerator that accept both a route name and route object.

Examples:

UrlGenerator::getPathFromRoute()

UrlGenerator::generateFromRoute()

(also supporting protected methods)

In Drupal 10, this would also allow us to string typehint for those methods too.

Proposed resolution

Trigger a deprecation message when a route object is passed in.

Remaining tasks

While there's not a strict dependency in either direction, this issue is closely linked to πŸ“Œ Deprecate UrlGenerator::supports() and UrlGenerator::getRouteDebugMessage() Fixed .

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Fixed

Version

10.1 ✨

Component
RoutingΒ  β†’

Last updated 7 days ago

Created by

πŸ‡¬πŸ‡§United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024