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

Revert "fix(FunctionComment): Recognise 'yield' as valid return statement (#2906931 #8)"

This reverts commit f5757e53.
parent f5757e53
No related branches found
No related tags found
No related merge requests found
......@@ -265,7 +265,7 @@ class FunctionCommentSniff implements Sniff
$searchStart = $stackPtr;
$foundNonVoidReturn = false;
do {
$returnToken = $phpcsFile->findNext(array(T_RETURN, T_YIELD), $searchStart, $endToken);
$returnToken = $phpcsFile->findNext(T_RETURN, $searchStart, $endToken);
if ($returnToken === false && $foundReturnToken === false) {
$error = '@return doc comment specified, but function has no return statement';
$phpcsFile->addError($error, $return, 'InvalidNoReturn');
......
......@@ -429,15 +429,3 @@ function test32($a, $b) {
function test33($a, $b) {
}
/**
* Yield should be a recognised return statement.
*
* @return int
* Integer value.
*/
function test34($a, $b) {
for ($i = 1; $i <= 3; $i++) {
yield $i;
}
}
......@@ -455,15 +455,3 @@ function test32($a, $b) {
function test33($a, $b) {
}
/**
* Yield should be a recognised return statement.
*
* @return int
* Integer value.
*/
function test34($a, $b) {
for ($i = 1; $i <= 3; $i++) {
yield $i;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment