You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classClassName {
/** * (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 */publicfunctionnext()
{
$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.
gsherwood
changed the title
The "Squiz.Commenting.FunctionComment" doesn't allow description in "@return" tag
The Squiz.Commenting.FunctionComment sniff doesn't allow description in @return tag
May 24, 2016
Code example:
I'm getting
Squiz.Commenting.FunctionComment.InvalidNoReturn
error (messageFunction 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
The text was updated successfully, but these errors were encountered: