Skip to content
Snippets Groups Projects

Issue #3425294: Remove deprecations for UrlGenerator methods

Open Issue #3425294: Remove deprecations for UrlGenerator methods
5 unresolved threads
5 unresolved threads

Closes #3425294

Merge request reports

Members who can merge are allowed to add commits.

Merged results pipeline #153391 passed

Merged results pipeline passed for 196a1255

Approval is optional
Code Quality is loading
Test summary results are being parsed
Ready to merge by members who can write to the target branch.

Merge details

  • The source branch is 1992 commits behind the target branch.
  • 1 commit will be added to 8.x-1.x.
  • Source branch will not be deleted.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
128 128 public function getPathFromRoute($name, $parameters = []) {
129 129 $route = $this->getRoute($name);
130 130 if (!is_string($name)) {
131 @trigger_error('Passing a route object to ' . __METHOD__ . '() is deprecated in drupal:10.1.0 and will not be supported in drupal:11.0.0. Pass the route name instead. See https://www.drupal.org/node/3172280', E_USER_DEPRECATED);
  • The issue summary suggests that $name should always be a string, so it doesn't make sense to have an is_string check here.

    Add string type to $name argument of \Drupal\Core\Routing\UrlGeneratorInterface

    Also there are no changes to UrlGeneratorInterface in this MR so we'll need to do that too.

  • Maintainer

    I think we should have a follow-up to add an explicit type hint to the interface method. In the meantime should we throw a LogicException or InvalidArgumentException if we get an object here?

  • I think this can just be done here? Because of contravariance we can add types to interface arguments at any time, and implementations can add them whenever they see fit (or continue widening the type if they need to).

  • Please register or sign in to reply
  • Thomas Tilak added 1 commit

    added 1 commit

    Compare with previous version

  • Thomas Tilak added 1 commit

    added 1 commit

    • cd7f9100 - removed mentions of Symfony route in all functions and add a type string hint

    Compare with previous version

  • 419 411 /**
    420 412 * Find the route using the provided route name.
    421 413 *
    422 * @param string|\Symfony\Component\Routing\Route $name
    423 * The route name or a route object.
    414 * @param string $name
    415 * The route name
  • 230 226 /**
    231 227 * Gets the path of a route.
    232 228 *
    233 * @param $name
    229 * @param string $name
    234 230 * The route name or other debug message.
  • 33 33 * substituted for them in the pattern. Extra params are added as query
    34 34 * strings to the URL.
    35 35 *
    36 * @param string|\Symfony\Component\Routing\Route $name
    37 * The route name or a route object.
    36 * @param string $name
    37 * The route name
  • 14 14 /**
    15 15 * Gets the internal path (system path) for a route.
    16 16 *
    17 * @param string|\Symfony\Component\Routing\Route $name
    18 * The route name or a route object.
    17 * @param string $name
    18 * The route name
  • Dave Long added 3 commits

    added 3 commits

    • 66d7674d - Fix comment nits.
    • a7ff9098 - Add argument types.
    • 30d32b2a - Remove methods that no longer exist in the parent interface.

    Compare with previous version

  • Dave Long added 1 commit

    added 1 commit

    • 4848a447 - ::generate() is allowed to be boolean in Drupal.

    Compare with previous version

  • Please register or sign in to reply
    Loading