Documentation

ForLoopWithTestFunctionCallSniff.php

Detects for-loops that use a function call in the test expression.

This rule is based on the PMD rule catalogue. 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; } } }
Tags
author

Greg Sherwood gsherwood@squiz.net

author

Manuel Pichler mapi@manuel-pichler.de

copyright

2007-2014 Manuel Pichler. All rights reserved.

license

https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence

Interfaces, Classes and Traits

ForLoopWithTestFunctionCallSniff

Search results