Skip to content
Snippets Groups Projects
Commit a5b5f6b5 authored by Klaus Purer's avatar Klaus Purer
Browse files

Issue #2222691: "Improved @return comment error message

parent e8315ad3
Branches
Tags 8.2.7 8.x-2.7
No related merge requests found
......@@ -283,7 +283,12 @@ class Drupal_Sniffs_Commenting_FunctionCommentSniff implements PHP_CodeSniffer_S
}
if ($comment === '' && $type !== '$this' && $type !== 'static') {
$error = 'Return comment must be on the next line';
if (strpos($type, ' ') !== false) {
$error = 'Description for the @return value must be on the next line';
} else {
$error = 'Description for the @return value is missing';
}
$phpcsFile->addError($error, $return, 'MissingReturnComment');
}//end if
}//end if
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment