PHP Classes

File: vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Download Installed Plugin   vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc   Download  
File: vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc
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: 2 days ago
Size: 914 bytes
 

Contents

Class file image Download
<?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) { }