Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
primogenial
/
wp-content
/
themes
/
storefront
/
vendor
/
squizlabs
/
php_codesniffer
/
src
/
Standards
/
Squiz
/
Tests
/
ControlStructures
:
ForEachLoopDeclarationUnitTest.inc
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php // Valid. foreach ($something as $blah => $that) { } // Invalid. foreach ( $something as $blah => $that ) { } foreach ($something as $blah => $that) { } foreach ($something as $blah => $that) { } foreach (${something}AS$blah=>$that) { } // The works. foreach ( $something aS $blah => $that ) { } // phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesAfterOpen 1 // phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 1 foreach ($something as $blah => $that) {} foreach ( $something as $blah => $that ) {} foreach ( $something as $blah => $that ) {} // phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesAfterOpen 0 // phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 0 foreach ([ 'foo' => 'bar', 'foobaz' => 'bazzy', ] as $key => $value) { }