Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Sep 2013 at 21:33 UTC
Updated:
10 May 2015 at 01:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jhodgdonI disagree with this meta issue... A well-chosen class name may not need any further one-line documentation that expands on it, and just because the one-line doesn't tell you anything more doesn't necessarily mean it's a bug.
So I'm making this a specific issue for this class, since this doesn't say what type of parameters are converted to what, and definitely it needs more information.
I was going to mark this novice, but since I also have no idea what this interface is for... hopefully someone does!
Comment #2
jhodgdonOh, I see on this issue that joachim explains what these parameter converters are for:
#2087107: document routing.yml parameter converters
So probably a novice could come up with a good patch for this.
Comment #3
rickwelch commentedWorking on this at Drupal Camp Costa Rica.
Comment #4
rickwelch commentedAdded small long description.
Comment #5
jhodgdonThanks for the patch -- good start!
So... I think we want to replace the existing first-line docs for this interface with documentation that actually gives us some information -- assuming we can do that in one 80-character line. Maybe, taking what you wrote, it could be:
Defines an interface for converting route parameters to classes.
[note that you misspelled classsed in your patch]
Then in a second paragraph, we can expand that information to explain what "parameters" mean in this case, and how/why they are converted to classes. I still am not sure what that means actually... and maybe this isn't such a great Novice project? Well, maybe you know more than I do, or maybe you can get help from someone in IRC with understanding it?
Comment #6
Crell commentedI was actually sitting next to Rick as he wrote this patch at an impromptu DrupalCamp CR new contributors sprint. :-) I like Jen's suggestion for improving the short description, and then just fixing up the spelling in the long description. (Explaining what a route parameter is is out of scope for this docblock, IMO.)
Rick, can you update the patch?
Comment #7
joachim commentedMy intention with #2087107: document routing.yml parameter converters was that this interface should be the documentation entry-point to the concept of parameter substitution in routing:
- it could be linked to from an eventual topic on @routing
- api.d.o already lists the class that implement the interface, so there is an automatic linkage to the things that do actual subs, which themselves can have more in-depth docs along with examples.
This way we get docs that are nicely navigable, AND keep the docs text close to the code.
> (Explaining what a route parameter is is out of scope for this docblock, IMO.)
Where would you put it?
Comment #8
Crell commentedIn some d.o-based documentation on the routing system. Why should we spread routing system documentation all over the code base? How would you know which of our 1000+ classes to look at for a detailed explanation of implementation details of 3 different systems interacting?
Besides, "implementation details" do not belong on an interface anyway. :-)
Comment #9
joachim commented> In some d.o-based documentation on the routing system
I'm suggesting that too: start with d.org pages and/or a @topic. Then link through to docs on this interface to explain the general process of taking values
> Why should we spread routing system documentation all over the code base
Keeping the docs close to the code is a good way of ensuring they stay in close sync -- isn't that the point of our having docs in code?
> Besides, "implementation details" do not belong on an interface anyway. :-)
I wasn't suggesting we put implementing details here, but an explanation of what implementing the interface allows classes to do.
Here's roughly what I'm suggesting:
This creates documentation that's close to the code, and is also easy to follow through a short pathway of links on api.d.o.
Comment #10
PavanL commentedAdded issue summary template.
Comment #11
mile23Rather amazed to find that #4 still applies.
Changed the docblock to look like this:
Also some action-verb changes to the method docblocks.
There isn't a routing topic on api.drupal.org, but there is @menu which is 'menu and routing,' which punts to Symfony documentation wrt routing.
Comment #13
mile23Not sure why SimpleTestBrowserTest is unhappy with my docblock changes, but there you go.
Comment #14
Crell commented"block object". Or ideally, specify the class name of the object. Returning a stdClass would be an error.
ConvertS
DetermineS
Comment #15
mile23Thanks.
For #1, it's an interface so saying {block} always returns a specific class isn't the way to go. Also, I just learned a bunch more about ParamConverters, that they're services, and that they're managed by a central service. So woot. :-)
#2 and #3: Nice.
Comment #16
jhodgdonLooks good to me! One minor nitpick:
This should not be in a @code block, I think?
Comment #17
mile23Done.
Comment #18
Crell commentedOK let's do. Thanks!
Comment #19
xjmThis is so much better than before. Well done!
This issue only changes documentation, so per https://www.drupal.org/core/beta-changes, this can be completed any time during the Drupal 8 beta phase. Committed and pushed to 8.0.x, thanks!