Problem/Motivation

As of https://docs.google.com/document/d/1BxgNvyIRcxYGzzA1DLkZ6A4-c8gGFixypNvP... we want to make clear which bits of the URL generation
machinery should be used

Proposed resolution

* \Drupal\Core\Routing\UrlGeneratorInterface::generatFromRoute() should be marked as internal.
* It should point to \Drupal\Core\Url instead

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#10 2606386-10.patch795 bytesanil280988
#4 2606386-4.patch786 bytessdstyles

Comments

dawehner created an issue. See original summary.

dawehner’s picture

Issue summary: View changes
dawehner’s picture

Component: base system » documentation
sdstyles’s picture

Status: Active » Needs review
StatusFileSize
new786 bytes
dawehner’s picture

+++ b/core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php
@@ -77,6 +77,9 @@ public function getPathFromRoute($name, $parameters = array());
+   * @internal Should not be used in user code.
+   *   Use \Drupal\Core\Url instead.

What about using this additional text?

   Instead create a \Drupal\Core\Url object directly, for example using
+   *   Url::fromRoute()

Pointing people to more information would be great!

jhodgdon’s picture

Status: Needs review » Needs work
+++ b/core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php
@@ -77,6 +77,9 @@ public function getPathFromRoute($name, $parameters = array());
+   * @internal Should not be used in user code.
+   *   Use \Drupal\Core\Url instead.

Don't put stuff with @internal. Just put it as @internal and if you want to add more docs, put that in a separate spot.

jhodgdon’s picture

Also really... These are not "documentation" issues. Marking something as @internal is an API decision. So please move all of these issues elsewhere.

er.manojsharma’s picture

Assigned: Unassigned » er.manojsharma
er.manojsharma’s picture

Assigned: er.manojsharma » Unassigned
anil280988’s picture

Status: Needs work » Needs review
StatusFileSize
new795 bytes

Moved text after @internal to separate line. Should we move this issue to some other Tag?

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +rc eligible

Reads fine for me.

xjm’s picture

Issue tags: -rc eligible +rc target

Discussed with @effulgentsia and we agreed on making this an RC target to minimize the surface of the routing and URL generation APIs prior to release.

Switching to RC target since marking something @internal isn't mere documentation; it also changes the contract with the developer in terms of BC, so it's better to review such changes individually in terms of the RC acceptance.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 10: 2606386-10.patch, failed testing.

The last submitted patch, 10: 2606386-10.patch, failed testing.

jhodgdon’s picture

Status: Needs work » Closed (duplicate)

Yes, duplicate.