API page: http://api.drupal.org/api/drupal/core%21includes%21common.inc/function/l/8
The docblock for l() needs improvement. It has at least the following issues:
- It doesn't specify all
@paramor@returntypes. - It doesn't specify the parameter defaults.
- It doesn't indicate whether the
$textshould be translated witht()or not. - It doesn't
@seeclosely-related functions. - It has the tiniest little grammar mistake.
Patch to follow.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | drupal-l-1779120-3.patch | 2.05 KB | traviscarden |
| #3 | interdiff-1779120-1-3.txt | 1.24 KB | traviscarden |
| #1 | drupal-l-1779120-1.patch | 2.13 KB | traviscarden |
Comments
Comment #1
traviscarden commentedNitpick!: The comma here implies a compound sentence break, but without an explicit subject after it, this isn't one.
$textneeds to be translated, and add an example as a fast, visual reminder.Indicate the default value of the parameter.
url()is closely-related. It's not only used inl(), but sometimes it's a good alternative to it.Comment #2
jhodgdonThat example you added, IMO, is entirely unnecessary. We aren't going to add usage examples to every function, and this one particularly doesn't need one since the function is called hundreds of times in core.
Also, this change in the patch:
This needs to be done in a different way. The sentence that was there was preparing for a list that follows. Adding that other sentence there breaks that.
Other that that... I don't have a problem with adding @see url and the param/return types, so that part is fine. Thanks!
Comment #3
traviscarden commentedOkay. Then how about this?
Comment #4
jhodgdonMuch better, thanks! I'll get this one committed shortly.
Comment #5
jhodgdonThanks again! Committed to 8.x and 7.x.