The following methods in node.module are missing the return type in their PHPDoc comments:
- node_title_list
- node_revision_delete
- node_is_page
- node_get_recent
- node_view
- node_view_multiple
- node_access_needs_rebuild
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | interdiff-7-9.txt | 1.61 KB | nicrodgers |
| #9 | 2599156-9.patch | 2.59 KB | nicrodgers |
| #7 | interdiff-2599156-2-7.txt | 822 bytes | nicrodgers |
| #7 | 2599156-7.patch | 3.46 KB | nicrodgers |
| #5 | interdiff-4-2.txt | 486 bytes | snehi |
Comments
Comment #2
nicrodgersPatch attached.
Comment #3
jhodgdonThanks! A few items to address:
This should be more specific than "array" for the type. Should be something like
\Name\Of\The\Interface[]
A flag is normally a Boolean value?
Comment #4
snehi commentedHi jhodgdon,
Thanks for the review, i am not able to understand what have your written for 1.
Meanwhile changing 2 as mentioned by you.
Comment #5
snehi commentedAdding interdiff.
Comment #6
jhodgdonRegarding comment #3 item 1 see:
https://www.drupal.org/node/1354#types
Comment #7
nicrodgersThanks for reviewing jhodgson and the feedback. I hadn't seen that doc page before, so it was really useful to see when we should mention the interface - thanks!
I've updated the patch from #2 to include your first comment, but with regards to the second comment and snehi's patch, I'm not sure it'd be accurate to say it returns boolean, as the function will only return a boolean if no value was provided for $rebuild (as per the comment). If a value for $rebuild is provided, the return statement is omitted. As per the PHP manual, "If the return() is omitted the value NULL will be returned". I've tried to address this in the updated patch by specifying return type as either bool|null which is more specific than the original "mixed".
Comment #8
jhodgdonThanks, looking better! Still needs a bit of improvement though.
I agree that this is the right type designation on the return line.
Can we also add a sentence to the return documentation that follows, saying something like:
If a value was provided for $rebuild, nothing is returned.
This line is still not quite right.
First, if you put a class in a return value type, you must include the namespace. This class has no namespace.
Second, if you make a @return line, it must have documentation, and this one doesn't.
Comment #9
nicrodgersThanks for the comments @jhodgdon. I've added a sentence to the comment as per (1) in your feedback.
I also realised that I erroneously included changes to system.module as part of the patch on this issue. I was working on that separately (and there are still quite a few other phpdoc changes needed in that file), so I've removed those changes from this latest patch, and I'll create a new issue for it.
This interdiff therefore reflects the new sentence, and the removal of the system.module changes. Hope that's ok.
Comment #10
nicrodgersComment #11
jhodgdonLooks good now, thanks!
Comment #12
alexpottCommitted bfef184 and pushed to 8.0.x. Thanks!