Class: ForLoopWithTestFunctionCallSniff
Source Location: /PHP_CodeSniffer-3.0.0/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php
Detects for-loops that use a function call in the test expression.
Author(s):
Copyright:
- 2007-2014 Manuel Pichler. All rights reserved.
Inherited Variables
Inherited Methods
Class Details
[line
33]
Detects for-loops that use a function call in the test expression.
This rule is based on the PMD rule catalog. Detects for-loops that use a function call in the test expression.
class Foo
{
public function bar($x)
{
$a = array(1, 2, 3, 4);
for ($i = 0; $i < count($a); $i++) {
$a[$i] *= $i;
}
}
}
Method Detail
process [line 58]
void process(
File
$phpcsFile, int
$stackPtr)
Processes this test, when one of its tokens is encountered.
Parameters:
\PHP_CodeSniffer\Files\File
$phpcsFile
—
The file being scanned.
int
$stackPtr
—
The position of the current token in the stack passed in $tokens.
register [line 42]
Registers the tokens that this sniff wants to listen for.
Documentation generated on 2019年3月11日 14:23:10 -0400 by
phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.