diff --git a/Modernize/Sniffs/FunctionCalls/DirnameSniff.php b/Modernize/Sniffs/FunctionCalls/DirnameSniff.php index 14dfed1a..53b49f69 100644 --- a/Modernize/Sniffs/FunctionCalls/DirnameSniff.php +++ b/Modernize/Sniffs/FunctionCalls/DirnameSniff.php @@ -150,6 +150,8 @@ public function process(File $phpcsFile, $stackPtr) * PHP 5.3+: Detect use of dirname(__FILE__). */ if (\strtoupper($pathParam['clean']) === '__FILE__') { + $levelsValue = false; + // Determine if the issue is auto-fixable. $hasComment = $phpcsFile->findNext(Tokens::$commentTokens, ($opener + 1), $closer); $fixable = ($hasComment === false); @@ -248,7 +250,12 @@ public function process(File $phpcsFile, $stackPtr) */ // Step 1: Are there comments ? If so, not auto-fixable as we don't want to remove comments. - $fixable = true; + $fixable = true; + $outerLevelsValue = false; + $innerParameters = []; + $innerLevelsParam = false; + $innerLevelsValue = false; + for ($i = ($opener + 1); $i < $closer; $i++) { if (isset(Tokens::$commentTokens[$tokens[$i]['code']])) { $fixable = false; diff --git a/Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php b/Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php index 2deee1a8..3499506e 100644 --- a/Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php +++ b/Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php @@ -127,6 +127,7 @@ public function process(File $phpcsFile, $stackPtr) * so from here on out, we **know** there will be tabs in the content. */ $origContent = $token['orig_content']; + $commentOnly = ''; $multiLineComment = false; if (($tokens[$i]['code'] === \T_COMMENT diff --git a/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php b/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php index 79210db3..32d04654 100644 --- a/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php +++ b/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php @@ -208,7 +208,11 @@ public function process(File $phpcsFile, $stackPtr) $origContent = $tokens[$i]['orig_content']; } - $spaces = 0; + $spaces = 0; + $length = 0; + $content = ''; + $closer = ''; + switch ($tokens[$i]['code']) { case \T_WHITESPACE: if ($this->ignoreBlankLines === true