As described in #2471485: Standardize getter docblocks we want to standardize on using "Gets" instead of "Returns" on getter docblocks, matching the outside world and making core internally consistent. In general, we make the verb match the one in the method name.
Drupal\Core\Entity is one of the biggest offenders in core (compared to Config which uses "Gets" almost exclusively, for example), and also the one most visible to contrib, since the docblocks here cascade into contrib entity types.
I will reroll any patch broken by these changes (just list them in this issue or the parent meta).
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 2471653-6-standardize-getter-docblocks.patch | 55.18 KB | Kazanir |
| #1 | 2471653-1-standardize-getter-docblocks.patch | 55.47 KB | bojanz |
Comments
Comment #1
bojanz commentedComment #2
anavarreIsn't this a DX regression to not indicate that this should return TRUE somehow?
Else this looks good to me.
Comment #3
anavarreComment #4
bojanz commented@#2
No, we use the same wording in many places across core. The boolean return is both implicit in the wording, and documented separately via @return
Comment #5
Kazanir commentedLooks like "returns" is being used as a substitute for what the function actually does (the replacements range from "gets" to "determines" to "builds" to "instantiates") in several different types of functions. Getting rid of that ambiguity (and standardizing getters) is a good move.
Comment #7
Kazanir commentedNeeds a slight reroll to apply actually...
Comment #8
alexpottCommitted 7171165 and pushed to 8.0.x. Thanks!