Skip to content

Commit

Permalink
Allow "return" directly after PHP open tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jul 13, 2016
1 parent 77d8483 commit 62247b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CakePHP/Sniffs/Formatting/BlankLineBeforeReturnSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)

if (isset($prevLineTokens[0])
&& ($prevLineTokens[0] === 'T_OPEN_CURLY_BRACKET'
|| $prevLineTokens[0] === 'T_COLON')
|| $prevLineTokens[0] === 'T_COLON'
|| $prevLineTokens[0] === 'T_OPEN_TAG')
) {
return;
} elseif (count($prevLineTokens) > 0) {
Expand Down
4 changes: 4 additions & 0 deletions CakePHP/tests/files/blank_line_before_return_1_pass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
return [
'foo' => 'bar'
];

0 comments on commit 62247b6

Please sign in to comment.