annotate vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeIndentStandard.xml @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 129ea1e6d783
children
rev   line source
Chris@0 1 <documentation title="Scope Indentation">
Chris@0 2 <standard>
Chris@0 3 <![CDATA[
Chris@0 4 Any scope openers except for switch statements should be indented 1 level. This includes classes, functions, and control structures.
Chris@0 5 ]]>
Chris@0 6 </standard>
Chris@0 7 <code_comparison>
Chris@0 8 <code title="Valid: Consistent indentation level for scope.">
Chris@0 9 <![CDATA[
Chris@0 10 function foo()
Chris@0 11 {
Chris@0 12 <em> </em>if ($test) {
Chris@0 13 <em> </em>$var = 1;
Chris@0 14 <em> </em>}
Chris@0 15 }
Chris@0 16 ]]>
Chris@0 17 </code>
Chris@0 18 <code title="Invalid: Indentation is not used for scope.">
Chris@0 19 <![CDATA[
Chris@0 20 function foo()
Chris@0 21 {
Chris@0 22 <em></em>if ($test) {
Chris@0 23 <em></em>$var = 1;
Chris@0 24 <em></em>}
Chris@0 25 }
Chris@0 26 ]]>
Chris@0 27 </code>
Chris@0 28 </code_comparison>
Chris@0 29 </documentation>