Skip to content
This repository has been archived by the owner on Oct 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #15 from M6Web/fix/return-closure
Browse files Browse the repository at this point in the history
Return in closure not checked for @return comment
  • Loading branch information
jdlabails committed Mar 11, 2016
2 parents 0937a30 + 7be0d2b commit b668786
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Symfony2/Sniffs/Commenting/FunctionCommentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected function processReturn(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $co
// iterate over all return statements of this function,
// run the check on the first which is not only 'return;'
while ($returnToken = $phpcsFile->findNext(T_RETURN, $start, $tokens[$stackPtr]['scope_closer'])) {
if ($this->isMatchingReturn($tokens, $returnToken)) {
if ($this->isMatchingReturn($tokens, $returnToken) && !in_array('PHPCS_T_CLOSURE', $tokens[$returnToken]['conditions'])) {
parent::processReturn($phpcsFile, $stackPtr, $commentStart);
break;
}
Expand Down

0 comments on commit b668786

Please sign in to comment.