Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
A few places, the @return documentation doesn't include the full namespace starting with \Drupal
Proposed resolution
We should fix this, and make the documentation more consistant
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#4 | interdiff.txt | 1.37 KB | googletorp |
#4 | use_full_namespace_for-2472453-4.patch | 1.4 KB | googletorp |
#1 | use_full_namespace_for-2472453-1.patch | 1.4 KB | googletorp |
Comments
Comment #1
googletorp CreditAttribution: googletorp commentedComment #2
jhodgdonThanks for the patch! Needs a bit of work though...
Is this returning a new instance of the class, or the current instance of the class?
If it's the current one, it should say
@return $this
with no description.
If it's a new instance, it should say
@return static
Can you also add a blank line before the @return? Also this @return needs documentation.
Comment #3
googletorp CreditAttribution: googletorp commentedThanks for the review.
Regarding setTargetType, for all entity interfaces that I've seeen (like NodeInterface) setters return $this, but the interface documentation is like the above example, with @return \Drupal\node\NodeInterface. Does that mean, that this is also wrong, and the proper documentation in this case would be @return $this instead?
Comment #4
googletorp CreditAttribution: googletorp commentedAdded new patch based on comments from jhodgdon.
Comment #5
jhodgdonLooks fine, thanks!
Comment #7
xjmThanks @googletorp for the patch. It looks correct to me as well.
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.