Skip to content

Commit

Permalink
Fixed bug #938 : CallTimePassByReferenceSniff ignores functions with …
Browse files Browse the repository at this point in the history
…return value
  • Loading branch information
gsherwood committed Mar 29, 2016
1 parent 884a8ae commit d841a8e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,8 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
// within their definitions. For example: function myFunction...
// "myFunction" is T_STRING but we should skip because it is not a
// function or method *call*.
// Also skip if the return value is being assigned to a variable.
$prevCode = $tokens[$prev]['code'];
if ($prevCode === T_FUNCTION
|| $prevCode === T_CLASS
|| isset(PHP_CodeSniffer_Tokens::$assignmentTokens[$prevCode]) === true
) {
if ($prevCode === T_FUNCTION || $prevCode === T_CLASS) {
return;
}

Expand Down
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fixed bug #928 : Endless loop when sniffing a PHP file with a git merge conflict inside a function
- Fixed bug #937 : Shebang can cause PSR1 SideEffects warning
-- Thanks to Clay Loveless for the patch
- Fixed bug #938 : CallTimePassByReferenceSniff ignores functions with return value
</notes>
<contents>
<dir name="/">
Expand Down

0 comments on commit d841a8e

Please sign in to comment.