diff --git a/src/Sniffs/AbstractScopeSniff.php b/src/Sniffs/AbstractScopeSniff.php index 86a140781b..d2b6979d57 100644 --- a/src/Sniffs/AbstractScopeSniff.php +++ b/src/Sniffs/AbstractScopeSniff.php @@ -123,7 +123,7 @@ final public function register() * * @return void|int Optionally returns a stack pointer. The sniff will not be * called again on the current file until the returned stack - * pointer is reached. Return ($phpcsFile->numTokens + 1) to skip + * pointer is reached. Return `$phpcsFile->numTokens` to skip * the rest of the file. * @see processTokenWithinScope() */ @@ -164,7 +164,7 @@ final public function process(File $phpcsFile, $stackPtr) * * @return void|int Optionally returns a stack pointer. The sniff will not be * called again on the current file until the returned stack - * pointer is reached. Return ($phpcsFile->numTokens + 1) to skip + * pointer is reached. Return `$phpcsFile->numTokens` to skip * the rest of the file. */ abstract protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope); @@ -180,7 +180,7 @@ abstract protected function processTokenWithinScope(File $phpcsFile, $stackPtr, * * @return void|int Optionally returns a stack pointer. The sniff will not be * called again on the current file until the returned stack - * pointer is reached. Return (count($tokens) + 1) to skip + * pointer is reached. Return `$phpcsFile->numTokens` to skip * the rest of the file. */ abstract protected function processTokenOutsideScope(File $phpcsFile, $stackPtr); diff --git a/src/Sniffs/AbstractVariableSniff.php b/src/Sniffs/AbstractVariableSniff.php index 6493d5701a..34a3b43aa0 100644 --- a/src/Sniffs/AbstractVariableSniff.php +++ b/src/Sniffs/AbstractVariableSniff.php @@ -72,7 +72,7 @@ public function __construct() * * @return void|int Optionally returns a stack pointer. The sniff will not be * called again on the current file until the returned stack - * pointer is reached. Return ($phpcsFile->numTokens + 1) to skip + * pointer is reached. Return `$phpcsFile->numTokens` to skip * the rest of the file. */ final protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) @@ -156,7 +156,7 @@ final protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $cu * * @return void|int Optionally returns a stack pointer. The sniff will not be * called again on the current file until the returned stack - * pointer is reached. Return ($phpcsFile->numTokens + 1) to skip + * pointer is reached. Return `$phpcsFile->numTokens` to skip * the rest of the file. */ final protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) @@ -187,7 +187,7 @@ final protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) * * @return void|int Optionally returns a stack pointer. The sniff will not be * called again on the current file until the returned stack - * pointer is reached. Return ($phpcsFile->numTokens + 1) to skip + * pointer is reached. Return `$phpcsFile->numTokens` to skip * the rest of the file. */ abstract protected function processMemberVar(File $phpcsFile, $stackPtr); @@ -202,7 +202,7 @@ abstract protected function processMemberVar(File $phpcsFile, $stackPtr); * * @return void|int Optionally returns a stack pointer. The sniff will not be * called again on the current file until the returned stack - * pointer is reached. Return ($phpcsFile->numTokens + 1) to skip + * pointer is reached. Return `$phpcsFile->numTokens` to skip * the rest of the file. */ abstract protected function processVariable(File $phpcsFile, $stackPtr); @@ -221,7 +221,7 @@ abstract protected function processVariable(File $phpcsFile, $stackPtr); * * @return void|int Optionally returns a stack pointer. The sniff will not be * called again on the current file until the returned stack - * pointer is reached. Return ($phpcsFile->numTokens + 1) to skip + * pointer is reached. Return `$phpcsFile->numTokens` to skip * the rest of the file. */ abstract protected function processVariableInString(File $phpcsFile, $stackPtr); diff --git a/src/Sniffs/Sniff.php b/src/Sniffs/Sniff.php index 3556edd532..e0f7cfe9c1 100644 --- a/src/Sniffs/Sniff.php +++ b/src/Sniffs/Sniff.php @@ -71,7 +71,7 @@ public function register(); * * @return void|int Optionally returns a stack pointer. The sniff will not be * called again on the current file until the returned stack - * pointer is reached. Return (count($tokens) + 1) to skip + * pointer is reached. Return `$phpcsFile->numTokens` to skip * the rest of the file. */ public function process(File $phpcsFile, $stackPtr); diff --git a/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php b/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php index 8a4884d3ce..41efffa4df 100644 --- a/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php +++ b/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php @@ -150,7 +150,7 @@ public function process(File $phpcsFile, $stackPtr) // tag in short open tags and scan run with short_open_tag=Off. // Bow out completely as any further detection will be unreliable // and create incorrect fixes or cause fixer conflicts. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } unset($nextNonEmpty, $start); diff --git a/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php b/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php index 2e4b251926..6df4c1ffb2 100644 --- a/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php +++ b/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php @@ -52,7 +52,7 @@ public function process(File $phpcsFile, $stackPtr) { $csslintPath = Config::getExecutablePath('csslint'); if ($csslintPath === null) { - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } $fileName = $phpcsFile->getFilename(); @@ -61,7 +61,7 @@ public function process(File $phpcsFile, $stackPtr) exec($cmd, $output, $retval); if (is_array($output) === false) { - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } $count = count($output); @@ -90,7 +90,7 @@ public function process(File $phpcsFile, $stackPtr) }//end for // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php b/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php index 6a90533a98..c0b584c322 100644 --- a/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php +++ b/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php @@ -69,7 +69,7 @@ public function process(File $phpcsFile, $stackPtr) { $lintPath = Config::getExecutablePath('gjslint'); if ($lintPath === null) { - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } $fileName = $phpcsFile->getFilename(); @@ -79,7 +79,7 @@ public function process(File $phpcsFile, $stackPtr) exec($cmd, $output, $retval); if (is_array($output) === false) { - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } foreach ($output as $finding) { @@ -111,7 +111,7 @@ public function process(File $phpcsFile, $stackPtr) }//end foreach // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php b/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php index e62e6856cd..65faed9911 100644 --- a/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php +++ b/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php @@ -60,7 +60,7 @@ public function process(File $phpcsFile, $stackPtr) { $eslintPath = Config::getExecutablePath('eslint'); if ($eslintPath === null) { - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } $filename = $phpcsFile->getFilename(); @@ -86,13 +86,13 @@ public function process(File $phpcsFile, $stackPtr) if ($code <= 0) { // No errors, continue. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } $data = json_decode(implode("\n", $stdout)); if (json_last_error() !== JSON_ERROR_NONE) { // Ignore any errors. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } // Data is a list of files, but we only pass a single one. @@ -107,7 +107,7 @@ public function process(File $phpcsFile, $stackPtr) } // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php b/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php index 5af7f772a5..f65c9a77da 100644 --- a/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php +++ b/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php @@ -55,7 +55,7 @@ public function process(File $phpcsFile, $stackPtr) $rhinoPath = Config::getExecutablePath('rhino'); $jshintPath = Config::getExecutablePath('jshint'); if ($jshintPath === null) { - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } $fileName = $phpcsFile->getFilename(); @@ -89,7 +89,7 @@ public function process(File $phpcsFile, $stackPtr) } // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php b/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php index a920bdf8a2..71bcabbb7f 100644 --- a/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php +++ b/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php @@ -76,7 +76,7 @@ public function process(File $phpcsFile, $stackPtr) } // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php b/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php index afff5587bc..3f76607560 100644 --- a/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php +++ b/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php @@ -83,7 +83,7 @@ public function process(File $phpcsFile, $stackPtr) } // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php b/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php index cb199aa691..8f597dfdf8 100644 --- a/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php +++ b/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php @@ -54,7 +54,7 @@ public function process(File $phpcsFile, $stackPtr) } // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php b/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php index e44d5147a2..1814b55558 100644 --- a/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php +++ b/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php @@ -68,7 +68,7 @@ public function process(File $phpcsFile, $stackPtr) if ($found === $this->eolChar) { // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } // Check for single line files without an EOL. This is a very special @@ -79,7 +79,7 @@ public function process(File $phpcsFile, $stackPtr) if ($tokens[$lastToken]['line'] === 1 && $tokens[$lastToken]['content'] !== "\n" ) { - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } } @@ -140,7 +140,7 @@ public function process(File $phpcsFile, $stackPtr) }//end if // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php b/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php index 94d4144a14..a65baf76b5 100644 --- a/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php +++ b/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php @@ -80,7 +80,7 @@ public function process(File $phpcsFile, $stackPtr) $this->checkLineLength($phpcsFile, $tokens, $i); // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php b/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php index 608fdcf6b0..1773cb8a6b 100644 --- a/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php +++ b/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php @@ -44,7 +44,7 @@ public function process(File $phpcsFile, $stackPtr) { $filename = $phpcsFile->getFilename(); if ($filename === 'STDIN') { - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } $filename = basename($filename); @@ -62,7 +62,7 @@ public function process(File $phpcsFile, $stackPtr) } // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Generic/Sniffs/PHP/SyntaxSniff.php b/src/Standards/Generic/Sniffs/PHP/SyntaxSniff.php index 0005112739..7297ebc134 100644 --- a/src/Standards/Generic/Sniffs/PHP/SyntaxSniff.php +++ b/src/Standards/Generic/Sniffs/PHP/SyntaxSniff.php @@ -67,7 +67,7 @@ public function process(File $phpcsFile, $stackPtr) } // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php b/src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php index 4a573b0687..67ca59ae96 100644 --- a/src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php +++ b/src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php @@ -220,7 +220,7 @@ public function process(File $phpcsFile, $stackPtr) }//end for // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Generic/Sniffs/VersionControl/SubversionPropertiesSniff.php b/src/Standards/Generic/Sniffs/VersionControl/SubversionPropertiesSniff.php index 446ee98197..3e6c5fe1fc 100644 --- a/src/Standards/Generic/Sniffs/VersionControl/SubversionPropertiesSniff.php +++ b/src/Standards/Generic/Sniffs/VersionControl/SubversionPropertiesSniff.php @@ -58,7 +58,7 @@ public function process(File $phpcsFile, $stackPtr) $properties = $this->getProperties($path); if ($properties === null) { // Not under version control. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } $allProperties = ($properties + $this->properties); @@ -101,7 +101,7 @@ public function process(File $phpcsFile, $stackPtr) }//end foreach // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php b/src/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php index e812500e51..ca2daafcac 100644 --- a/src/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php +++ b/src/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php @@ -212,7 +212,7 @@ public function process(File $phpcsFile, $stackPtr) }//end for // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php b/src/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php index 51a859e84d..e230916ca3 100644 --- a/src/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php +++ b/src/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php @@ -184,7 +184,7 @@ public function process(File $phpcsFile, $stackPtr) }//end for // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php b/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php index 1c12e3013f..c47466a0d5 100644 --- a/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php +++ b/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php @@ -122,18 +122,18 @@ public function process(File $phpcsFile, $stackPtr) if ($tokens[$commentStart]['code'] === T_CLOSE_TAG) { // We are only interested if this is the first open tag. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } else if ($tokens[$commentStart]['code'] === T_COMMENT) { $error = 'You must use "/**" style comments for a file comment'; $phpcsFile->addError($error, $errorToken, 'WrongStyle'); $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } else if ($commentStart === false || $tokens[$commentStart]['code'] !== T_DOC_COMMENT_OPEN_TAG ) { $phpcsFile->addError('Missing file doc comment', $errorToken, 'Missing'); $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } $commentEnd = $tokens[$commentStart]['comment_closer']; @@ -178,7 +178,7 @@ public function process(File $phpcsFile, $stackPtr) if (in_array($tokens[$nextToken]['code'], $ignore, true) === true) { $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); @@ -205,7 +205,7 @@ public function process(File $phpcsFile, $stackPtr) $this->processTags($phpcsFile, $stackPtr, $commentStart); // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php b/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php index 5f22b1f9c5..68a18d8c76 100644 --- a/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php +++ b/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php @@ -56,7 +56,7 @@ public function process(File $phpcsFile, $stackPtr) } // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php b/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php index d5e3e069e1..5b2d2817b7 100644 --- a/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php +++ b/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php @@ -43,7 +43,7 @@ public function register() public function process(File $phpcsFile, $stackPtr) { if ($phpcsFile->findNext(T_INLINE_HTML, ($stackPtr + 1)) !== false) { - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } // Skip to the end of the file. @@ -64,7 +64,7 @@ public function process(File $phpcsFile, $stackPtr) } $phpcsFile->recordMetric($stackPtr, 'Number of newlines at EOF', '0'); - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } // Go looking for the last non-empty line. @@ -99,7 +99,7 @@ public function process(File $phpcsFile, $stackPtr) } // Skip the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php b/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php index d9241f1b66..cfff91fc6d 100644 --- a/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php +++ b/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php @@ -55,11 +55,11 @@ public function process(File $phpcsFile, $stackPtr) if ($tokens[$commentStart]['code'] === T_COMMENT) { $phpcsFile->addError('You must use "/**" style comments for a file comment', $commentStart, 'WrongStyle'); $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } else if ($commentStart === false || $tokens[$commentStart]['code'] !== T_DOC_COMMENT_OPEN_TAG) { $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } if (isset($tokens[$commentStart]['comment_closer']) === false @@ -67,7 +67,7 @@ public function process(File $phpcsFile, $stackPtr) && $tokens[$commentStart]['comment_closer'] === ($phpcsFile->numTokens - 1)) ) { // Don't process an unfinished file comment during live coding. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } $commentEnd = $tokens[$commentStart]['comment_closer']; @@ -116,7 +116,7 @@ public function process(File $phpcsFile, $stackPtr) if (in_array($tokens[$nextToken]['code'], $ignore, true) === true) { $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); @@ -220,7 +220,7 @@ public function process(File $phpcsFile, $stackPtr) }//end foreach // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php b/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php index 30b3071d71..52bff6cc57 100644 --- a/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php +++ b/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php @@ -54,7 +54,7 @@ public function process(File $phpcsFile, $stackPtr) $rhinoPath = Config::getExecutablePath('rhino'); $jslintPath = Config::getExecutablePath('jslint'); if ($rhinoPath === null || $jslintPath === null) { - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } $fileName = $phpcsFile->getFilename(); @@ -80,7 +80,7 @@ public function process(File $phpcsFile, $stackPtr) } // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php b/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php index eb2b294559..89b704fed8 100644 --- a/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php +++ b/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php @@ -54,7 +54,7 @@ public function process(File $phpcsFile, $stackPtr) { $jslPath = Config::getExecutablePath('jsl'); if ($jslPath === null) { - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } $fileName = $phpcsFile->getFilename(); @@ -83,7 +83,7 @@ public function process(File $phpcsFile, $stackPtr) } // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php b/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php index 4ba28a3eef..aceecffd36 100644 --- a/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php +++ b/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php @@ -60,7 +60,7 @@ public function process(File $phpcsFile, $stackPtr) } // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php b/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php index 7bf1f0ad0a..5470ae4bfc 100644 --- a/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php +++ b/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php @@ -48,7 +48,7 @@ public function process(File $phpcsFile, $stackPtr) { $analyzerPath = Config::getExecutablePath('zend_ca'); if ($analyzerPath === null) { - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; } $fileName = $phpcsFile->getFilename(); @@ -92,7 +92,7 @@ public function process(File $phpcsFile, $stackPtr) } // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process() diff --git a/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php b/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php index 24ea495b48..7b547bfd82 100644 --- a/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php +++ b/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php @@ -71,7 +71,7 @@ public function process(File $phpcsFile, $stackPtr) }//end if // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); + return $phpcsFile->numTokens; }//end process()