diff --git a/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php b/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php index 495151ea38..ba4ad3e777 100644 --- a/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php +++ b/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php @@ -87,7 +87,6 @@ public function process(File $phpcsFile, $stackPtr) $find = [ T_COMMA, - T_VARIABLE, T_CLOSURE, T_ANON_CLASS, T_OPEN_SHORT_ARRAY, @@ -157,28 +156,6 @@ public function process(File $phpcsFile, $stackPtr) } } }//end if - } else { - // Token is a variable. - $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextSeparator + 1), $closeBracket, true); - if ($nextToken !== false) { - if ($tokens[$nextToken]['code'] === T_EQUAL) { - if (($tokens[($nextToken - 1)]['code']) !== T_WHITESPACE) { - $error = 'Expected 1 space before = sign of default value'; - $fix = $phpcsFile->addFixableError($error, $nextToken, 'NoSpaceBeforeEquals'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($nextToken, ' '); - } - } - - if ($tokens[($nextToken + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space after = sign of default value'; - $fix = $phpcsFile->addFixableError($error, $nextToken, 'NoSpaceAfterEquals'); - if ($fix === true) { - $phpcsFile->fixer->addContent($nextToken, ' '); - } - } - } - } }//end if }//end while diff --git a/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc.fixed b/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc.fixed index b8bb8faef4..0ca70ca05f 100644 --- a/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc.fixed +++ b/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.inc.fixed @@ -8,9 +8,9 @@ $result = myFunction($arg1, $arg2); $result = myFunction($arg1, $arg2, $arg3, $arg4, $arg5); $result = myFunction($arg1, $arg2, $arg3, $arg4, $arg5); $result = myFunction($arg1, $arg2 = array()); -$result = myFunction($arg1, $arg2 = array()); -$result = myFunction($arg1, $arg2 = array()); -$result = myFunction($arg1, $arg2 = array()); +$result = myFunction($arg1, $arg2 =array()); +$result = myFunction($arg1, $arg2= array()); +$result = myFunction($arg1, $arg2=array()); $result = myFunction($arg1, $arg2 = array(), @@ -147,5 +147,5 @@ $foobar = functionCallAnonClassParam( $foo = array(1,2,3); } }, - $args = array(), + $args=array(), ); diff --git a/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php b/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php index 2a9781d04c..cb1c2e0867 100644 --- a/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php +++ b/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php @@ -30,9 +30,9 @@ public function getErrorList() 6 => 1, 7 => 2, 8 => 1, - 11 => 2, - 12 => 2, - 13 => 3, + 11 => 1, + 12 => 1, + 13 => 1, 42 => 3, 43 => 3, 45 => 1, @@ -52,7 +52,6 @@ public function getErrorList() 132 => 2, 133 => 2, 134 => 1, - 150 => 2, ]; }//end getErrorList()