PHP Classes

File: vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForLoopDeclarationStandard.xml

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Download Installed Plugin   vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForLoopDeclarationStandard.xml   Download  
File: vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForLoopDeclarationStandard.xml
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Download Installed Plugin
Download a WordPress plugin as a ZIP archive
Author: By
Last change:
Date: Yesterday
Size: 1,418 bytes
 

Contents

Class file image Download
<documentation title="For Loop Declarations"> <standard> <![CDATA[ In a for loop declaration, there should be no space inside the brackets and there should be 0 spaces before and 1 space after semicolons. ]]> </standard> <code_comparison> <code title="Valid: Correct spacing used."> <![CDATA[ for (<em></em>$i = 0; $i < 10; $i++<em></em>) { echo $i; } ]]> </code> <code title="Invalid: Invalid spacing used inside brackets."> <![CDATA[ for (<em> </em>$i = 0; $i < 10; $i++<em> </em>) { echo $i; } ]]> </code> </code_comparison> <code_comparison> <code title="Valid: Correct spacing used."> <![CDATA[ for ($i = 0<em></em>; $i < 10<em></em>; $i++) { echo $i; } ]]> </code> <code title="Invalid: Invalid spacing used before semicolons."> <![CDATA[ for ($i = 0<em> </em>; $i < 10<em> </em>; $i++) { echo $i; } ]]> </code> </code_comparison> <code_comparison> <code title="Valid: Correct spacing used."> <![CDATA[ for ($i = 0;<em> </em>$i < 10;<em> </em>$i++) { echo $i; } ]]> </code> <code title="Invalid: Invalid spacing used after semicolons."> <![CDATA[ for ($i = 0;<em></em>$i < 10;<em></em>$i++) { echo $i; } ]]> </code> </code_comparison> </documentation>