Problem/Motivation

In \Drupal\Core\Routing\UrlGenerator::__construct()

$this->provider = $provider;

Is a dynamic declaration

Proposed resolution

Declare and document the property

Remaining tasks

write patch

User interface changes

API changes

none

Data model changes

none

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pwolanin created an issue. See original summary.

ziomizar’s picture

ziomizar’s picture

Status: Active » Needs review
pwolanin’s picture

Status: Needs review » Needs work

Looks mostly right, but I don't think we need to type hint both interfaces, only RouteProviderInterface becuase PreloadableRouteProviderInterface extends RouteProviderInterface and we never call the extra method \Drupal\Core\Routing\PreloadableRouteProviderInterface::preLoadRoutes() in this context.

ziomizar’s picture

Ohhh, I was looking at class RoutePreloader to see an example of that, in that class is used PreloadableRouteProviderInterface.

ziomizar’s picture

Status: Needs work » Needs review
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Looks perfect

  • catch committed 182f8fd on 8.3.x
    Issue #2809801 by ziomizar: provider property is dynamically declared in...
catch’s picture

Version: 8.2.x-dev » 8.3.x-dev
Category: Bug report » Task

I added a note to the bc policy for public properties: https://www.drupal.org/node/2562903/revisions/view/10149671/10168259

Committed/pushed to 8.3.x, thanks!

This doesn't fix a bug, so not putting in 8.2.x

pwolanin’s picture

Status: Reviewed & tested by the community » Fixed

ok, so fixed then

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.