Problem/Motivation
$url->toString(TRUE)->getGeneratedUrl()
Seriously, what does TRUE even mean.
Proposed resolution
- Add
$url->generate()
- Deprecate \Drupal\Core\GeneratedUrl::getGeneratedUrl() in favor of \Drupal\Core\GeneratedUrl::toString().
- disputed: Deprecate \Drupal\Core\Url::toString() in favor of \Drupal\Core\GeneratedUrl::toString(). This will lead to longer constructs ($url->toString() becomes $url->generate()->toString()), but enables us to also deprecate MetadataBubblingUrlGenerator / the behind-the-scenes bubbling of metadata that has caused many LogicExceptions