Skip to content

Commit

Permalink
Fix issue with InstantiateNewClassesSniff
Browse files Browse the repository at this point in the history
The following line would trigger issues with the InstantiateNewClassesSniff:
$model = new JModelDatabase(new JRegistry, JFactory::getDbo());

This incorrectly finds the JFactory::getDbo() parenthesis and assumes they're there for the JRegistry call. This pull request adds the comma to the list of escape tokens to reset the call.
  • Loading branch information
pasamio committed Jun 18, 2012
1 parent ea5c8dc commit 7be8ff4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Sniffs/Classes/InstantiateNewClassesSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
switch ($tokens[$cnt]['code'])
{
case T_SEMICOLON:
case T_COMMA :
$valid = true;
$running = false;
break;
Expand Down

0 comments on commit 7be8ff4

Please sign in to comment.