PATH:
opt
/
cpanel
/
ea-wappspector
/
vendor
/
squizlabs
/
php_codesniffer
/
src
/
Standards
/
Squiz
/
Tests
/
WhiteSpace
<?php if ($something) { } foreach ($this as $that) { } while (true) { for ($i = 0; $i < 10; $i++) { } if ($something) { } foreach ($this as $that) { do { } while (true); } } if ($one) { } else ($two) { } else if ($three) { } elseif ($four) { } if ($one) { } else ($two) { } else if ($three) { } elseif ($four) { } ?> <table> <tr> <td align="center" valign="center"> <?php foreach ($this->children as $child) { // There should be no error after this // foreach, because it is followed by a // close PHP tag. } ?> </td> </tr> </table> <?php switch ($blah) { case 'one': if ($blah) { // There are no spaces before break. } break; default: if ($blah) { // There are no spaces before break. } break; } switch ($blah) { case 'one': if ($blah) { // There are no spaces before break. } break; default: if ($blah) { // Code here. } } foreach ($blah as $var) { if ($blah) { } break; } while (true) { for ($i = 0; $i < 10; $i++) { if ($something) { } } foreach ($this as $that) { do { echo $i; } while (true); } } function myFunction() { if ($blah) { } }//end myFunction() foreach ($this->children as $child) { echo $child; } if ($defaultPageDesign === 0 && $defaultCascade === TRUE && $defaultChildDesign === 0 ) { $settingsUpdated = FALSE; } foreach ( $blah as $var ) { if ( $blah ) { } } if ( $defaultPageDesign === 0 && $defaultCascade === TRUE && $defaultChildDesign === 0 ) { $settingsUpdated = FALSE; } $moo = 'blar'; switch ($moo) { case 'blar': if ($moo === 'blar2') { $moo = 'blar' } return $moo; default: $moo = 'moo'; break; } do { } while (true); try { // Something } catch (Exception $e) { // Something } try { // Something } catch (Exception $e) { // Something } if ($one) { } elseif ($two) { } // else if something else if ($three) { } // else do something else { } if ($one) { } do { echo 'hi'; } while ( $blah ); if ($one) { } // No blank line here. if ($two) { } switch ($moo) { case 'blar': if ($moo === 'blar2') { $moo = 'blar' } return $moo; } try { // Something } catch (Exception $e) { // Something } finally { // Something } if ($foo) { /** * Comment */ function foo() { // Code here } /** * Comment */ class bar() { }//end class } if (true) { // some comment goes here echo 'foo'; } if (true) { echo 'foo'; echo 'foo'; } if ($true) { echo 'hi 2'; }//end if echo 'hi'; if ($true) { echo 'hi 2'; } // phpcs:enable Standard.Category.Sniff -- for reasons. echo 'hi'; ?> <?php foreach($formset['Fieldset'] as $fieldset): ?> <?php foreach($fieldset['Field'] as $field): echo 'foo'; ?> <?php endforeach; ?> <?php endforeach; ?> <?php $expr = match( $foo ){ 1 => 1, 2 => 2, }; echo $expr; if($true) { enum SomeEnum {} }
[+]
..
[-] SuperfluousWhitespaceUnitTest.3.js.fixed
[edit]
[-] ScopeKeywordSpacingUnitTest.php
[edit]
[-] FunctionSpacingUnitTest.4.inc
[edit]
[-] SuperfluousWhitespaceUnitTest.4.inc
[edit]
[-] FunctionSpacingUnitTest.php
[edit]
[-] FunctionSpacingUnitTest.2.inc
[edit]
[-] OperatorSpacingUnitTest.1.inc
[edit]
[-] SuperfluousWhitespaceUnitTest.3.inc.fixed
[edit]
[-] ScopeKeywordSpacingUnitTest.1.inc.fixed
[edit]
[-] ControlStructureSpacingUnitTest.js
[edit]
[-] FunctionClosingBraceSpaceUnitTest.php
[edit]
[-] LogicalOperatorSpacingUnitTest.inc
[edit]
[-] PropertyLabelSpacingUnitTest.php
[edit]
[-] FunctionOpeningBraceSpaceUnitTest.php
[edit]
[-] PropertyLabelSpacingUnitTest.js.fixed
[edit]
[-] SuperfluousWhitespaceUnitTest.3.js
[edit]
[-] LogicalOperatorSpacingUnitTest.js
[edit]
[-] SuperfluousWhitespaceUnitTest.2.css.fixed
[edit]
[-] ScopeKeywordSpacingUnitTest.1.inc
[edit]
[-] FunctionSpacingUnitTest.2.inc.fixed
[edit]
[-] MemberVarSpacingUnitTest.1.inc.fixed
[edit]
[-] SemicolonSpacingUnitTest.inc
[edit]
[-] SuperfluousWhitespaceUnitTest.1.inc
[edit]
[-] LanguageConstructSpacingUnitTest.inc.fixed
[edit]
[-] SemicolonSpacingUnitTest.js.fixed
[edit]
[-] LanguageConstructSpacingUnitTest.php
[edit]
[-] FunctionClosingBraceSpaceUnitTest.inc.fixed
[edit]
[-] SemicolonSpacingUnitTest.php
[edit]
[-] OperatorSpacingUnitTest.js
[edit]
[-] ObjectOperatorSpacingUnitTest.inc
[edit]
[-] SuperfluousWhitespaceUnitTest.4.inc.fixed
[edit]
[-] ObjectOperatorSpacingUnitTest.inc.fixed
[edit]
[-] LogicalOperatorSpacingUnitTest.inc.fixed
[edit]
[-] ScopeKeywordSpacingUnitTest.4.inc
[edit]
[-] LogicalOperatorSpacingUnitTest.php
[edit]
[-] LogicalOperatorSpacingUnitTest.js.fixed
[edit]
[-] SuperfluousWhitespaceUnitTest.5.inc
[edit]
[-] FunctionSpacingUnitTest.3.inc.fixed
[edit]
[-] FunctionOpeningBraceSpaceUnitTest.js.fixed
[edit]
[-] SuperfluousWhitespaceUnitTest.3.css.fixed
[edit]
[-] FunctionSpacingUnitTest.1.inc.fixed
[edit]
[-] PropertyLabelSpacingUnitTest.js
[edit]
[-] SuperfluousWhitespaceUnitTest.5.inc.fixed
[edit]
[-] SemicolonSpacingUnitTest.inc.fixed
[edit]
[-] MemberVarSpacingUnitTest.php
[edit]
[-] CastSpacingUnitTest.inc.fixed
[edit]
[-] FunctionOpeningBraceSpaceUnitTest.inc.fixed
[edit]
[-] ScopeClosingBraceUnitTest.inc
[edit]
[-] ScopeKeywordSpacingUnitTest.3.inc.fixed
[edit]
[-] SemicolonSpacingUnitTest.js
[edit]
[-] SuperfluousWhitespaceUnitTest.1.js
[edit]
[-] SuperfluousWhitespaceUnitTest.1.css.fixed
[edit]
[-] OperatorSpacingUnitTest.php
[edit]
[-] ScopeClosingBraceUnitTest.inc.fixed
[edit]
[-] OperatorSpacingUnitTest.1.inc.fixed
[edit]
[-] ControlStructureSpacingUnitTest.js.fixed
[edit]
[-] LanguageConstructSpacingUnitTest.inc
[edit]
[-] FunctionClosingBraceSpaceUnitTest.js.fixed
[edit]
[-] FunctionSpacingUnitTest.1.inc
[edit]
[-] MemberVarSpacingUnitTest.2.inc
[edit]
[-] MemberVarSpacingUnitTest.3.inc
[edit]
[-] FunctionClosingBraceSpaceUnitTest.inc
[edit]
[-] FunctionSpacingUnitTest.6.inc
[edit]
[-] FunctionClosingBraceSpaceUnitTest.js
[edit]
[-] ScopeKeywordSpacingUnitTest.3.inc
[edit]
[-] OperatorSpacingUnitTest.3.inc
[edit]
[-] SuperfluousWhitespaceUnitTest.3.inc
[edit]
[-] SuperfluousWhitespaceUnitTest.2.inc.fixed
[edit]
[-] ControlStructureSpacingUnitTest.php
[edit]
[-] ObjectOperatorSpacingUnitTest.php
[edit]
[-] FunctionSpacingUnitTest.5.inc
[edit]
[-] SuperfluousWhitespaceUnitTest.2.inc
[edit]
[-] FunctionSpacingUnitTest.5.inc.fixed
[edit]
[-] SuperfluousWhitespaceUnitTest.1.js.fixed
[edit]
[-] SuperfluousWhitespaceUnitTest.2.js
[edit]
[-] CastSpacingUnitTest.php
[edit]
[-] SuperfluousWhitespaceUnitTest.1.inc.fixed
[edit]
[-] OperatorSpacingUnitTest.js.fixed
[edit]
[-] ControlStructureSpacingUnitTest.inc.fixed
[edit]
[-] FunctionSpacingUnitTest.3.inc
[edit]
[-] FunctionSpacingUnitTest.6.inc.fixed
[edit]
[-] ControlStructureSpacingUnitTest.inc
[edit]
[-] ScopeClosingBraceUnitTest.php
[edit]
[-] FunctionSpacingUnitTest.7.inc
[edit]
[-] SuperfluousWhitespaceUnitTest.2.js.fixed
[edit]
[-] CastSpacingUnitTest.inc
[edit]
[-] SuperfluousWhitespaceUnitTest.3.css
[edit]
[-] SuperfluousWhitespaceUnitTest.2.css
[edit]
[-] FunctionOpeningBraceSpaceUnitTest.js
[edit]
[-] OperatorSpacingUnitTest.2.inc
[edit]
[-] FunctionOpeningBraceSpaceUnitTest.inc
[edit]
[-] SuperfluousWhitespaceUnitTest.php
[edit]
[-] ScopeKeywordSpacingUnitTest.2.inc
[edit]
[-] SuperfluousWhitespaceUnitTest.1.css
[edit]
[-] MemberVarSpacingUnitTest.1.inc
[edit]