Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix issue with InstantiateNewClassesSniff #2

Merged
merged 1 commit into from

2 participants

@pasamio

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.

@pasamio pasamio Fix issue with InstantiateNewClassesSniff
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.
7be8ff4
@LouisLandry LouisLandry merged commit 23a8018 into joomla:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 18, 2012
  1. @pasamio

    Fix issue with InstantiateNewClassesSniff

    pasamio authored
    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.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  Sniffs/Classes/InstantiateNewClassesSniff.php
View
1  Sniffs/Classes/InstantiateNewClassesSniff.php
@@ -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;
Something went wrong with that request. Please try again.