Skip to content

Commit bf351dd

Browse files
committed
Generic/UselessOverridingMethod: remove redundant call to count()
This commit simply replaces a call to `count($token)` with `$phpcsFile->numTokens`.
1 parent 4aaa77e commit bf351dd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ public function process(File $phpcsFile, $stackPtr)
115115

116116
$parameters = [''];
117117
$parenthesisCount = 1;
118-
$count = count($tokens);
119-
for (++$next; $next < $count; ++$next) {
118+
for (++$next; $next < $phpcsFile->numTokens; ++$next) {
120119
$code = $tokens[$next]['code'];
121120

122121
if ($code === T_OPEN_PARENTHESIS) {

0 commit comments

Comments
 (0)