- Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Code example:
class ClassName { /** * (PHP 5 >= 5.0.0)<br/> * Move forward to next element * * @return void Any returned value is ignored. * @link http://php.net/manual/en/iterator.next.php */ public function next() { $this->offset++; } }
I'm getting Squiz.Commenting.FunctionComment.InvalidNoReturn
error (message Function return type is not void, but function has no return statement
) because @return
statement has a description after it. This is allowed in DocBlocks - https://www.phpdoc.org/docs/latest/references/phpdoc/tags/return.html .
I think, that we should explode @return
tag content into 2 parts by space, since spaces aren't allowed in returned type itself and only check 1st part as returned type.
Related Issue: #1018