Documentation

JumbledIncrementerSniff.php

Detects incrementer jumbling in for loops.

This rule is based on the PMD rule catalogue. The jumbling incrementer sniff detects the usage of one and the same incrementer into an outer and an inner loop. Even it is intended this is confusing code.

class Foo { public function bar($x) { for ($i = 0; $i < 10; $i++) { for ($k = 0; $k < 20; $i++) { echo 'Hello'; } } } }
Tags
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

JumbledIncrementerSniff

Search results