Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CakePHP/Sniffs/Formatting/BlankLineBeforeReturnSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public function process(File $phpcsFile, $stackPtr)
if ($tokens[$current]['line'] == $previousLine
&& $tokens[$current]['type'] !== 'T_WHITESPACE'
&& $tokens[$current]['type'] !== 'T_COMMENT'
&& $tokens[$current]['type'] !== 'T_DOC_COMMENT_OPEN_TAG'
&& $tokens[$current]['type'] !== 'T_DOC_COMMENT_TAG'
&& $tokens[$current]['type'] !== 'T_DOC_COMMENT_STRING'
&& $tokens[$current]['type'] !== 'T_DOC_COMMENT_CLOSE_TAG'
&& $tokens[$current]['type'] !== 'T_DOC_COMMENT_WHITESPACE'
) {
Expand Down
11 changes: 11 additions & 0 deletions CakePHP/Tests/Formatting/BlankLineBeforeReturnUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,14 @@ function validFunctionReturnSix()
return false;
}
}

/**
* [validFunctionReturnSeven description]
*
* @return null
*/
function validFunctionReturnSeven()
{
/** @var Foo $foo */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldnt we also fix that #172 issue that the inline doc blocks are fixed wrong in general? And that those are actually comments right now which they shouldnt be.
You can look into the existing sniffers I mentioned.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would require changing another sniff and beyond the scope of this PR.

return null;
}
11 changes: 11 additions & 0 deletions CakePHP/Tests/Formatting/BlankLineBeforeReturnUnitTest.inc.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,14 @@ function validFunctionReturnSix()
return false;
}
}

/**
* [validFunctionReturnSeven description]
*
* @return null
*/
function validFunctionReturnSeven()
{
/** @var Foo $foo */
return null;
}