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.
This is trivial (low priority and a workaround exists), but worth reporting.
The following function comment is quoted from the online Drupal docs, and this is made clear by 'Quotes':
/**
* 'The type of list to return (e.g. "ul", "ol")'.
*
* @return string
* 'The type of list to return (e.g. "ul", "ol").'
*/
public function getType() {
return $this->type;
}
Coder reports:
ERROR | Function comment short description must start with a capital letter
Of course it's easily solved with something like:
/**
* Gets the 'type of list to return (e.g. "ul", "ol")'.
*
* @return string
* 'The type of list to return (e.g. "ul", "ol").'
*/
public function getType() {
return $this->type;
}
But I can see no good reason why some punctuation should not be allowed in the rule.
[EDIT: amended original getter docs incorrectly had @param not @return]
Comments
Comment #1
webel CreditAttribution: webel commentedComment #2
webel CreditAttribution: webel commentedComment #3
klausiCould you provide a link/reference where this is located in the Drupal docs?
Sounds like a bug in the documentation to me, since it does not make sense to use quotes here. Are there any realistic examples where quotes would make sense at the beginning?
Comment #4
webel CreditAttribution: webel commentedThe only case I can think of is, for educational purposes, and as a courtesy to the original source, quoting say copied Drupal.org docs, like the example showed.
If I do not quote 'The type of list to return (e.g. "ul", "ol")', it is clumsy to have to indicate afterwards that it was quoted. But it's not very important.
Comment #5
klausiIf you just want to repeat docs on overridden methods then you should use {@inheritdoc}.
So I don't think we have a use case to allow quotes at the beginning.