Documentation

ForLoopShouldBeWhileLoopSniff.php

Detects for-loops that can be simplified to a while-loop.

This rule is based on the PMD rule catalogue. Detects for-loops that can be simplified as a while-loop.

class Foo { public function bar($x) { for (;true;) true; // No Init or Update part, may as well be: while (true) } }
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

ForLoopShouldBeWhileLoopSniff

Search results