Closed kewlar closed 9 years ago
Hi (:
Do you have an example with more context?
Sure thing (:
/**
* Get company
*
* @return \Pim\UserBundle\Entity\Company
*/
public function getCompany()
{
return $this->company;
}
The Doctrine entity code here was probably generated by an IDE or a doctrine:generate:entities
command, and it -- stupidly -- left a space symbol at the end of the @return
line (not sure if the comment will preserve the whitespace).
The code sniffer throws up on that:
If you don't mind, I've got a test, and a fix. Pull request incoming in 3... 2... 1...
Let's say we have a
@return int
in a function's docblock. Here,$token['content'] === 'int '
. The result:The sniffer correctly reports "Whitespace found at end of line", but it also incorrectly adds "Return comment must start with a capital letter" and "Return comment must end with a full stop". There should not be further errors about a return comment, because there is no return comment.
The bug is both in 2.x and in master branches (line 332 on master branch).