PHP Classes

File: vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc.fixed

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Download Installed Plugin   vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc.fixed   Download  
File: vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc.fixed
Role: Example script
Content type: text/plain
Description: Example script
Class: Download Installed Plugin
Download a WordPress plugin as a ZIP archive
Author: By
Last change:
Date: 2 days ago
Size: 867 bytes
 

Contents

Class file image Download
<?php
$test
= $this->testThis();
$test = $this->testThis();
$test = $this->testThis();
for (
$var = 1; $var < 10; $var++) {
    echo
$var;
}
$test = $this->testThis(); /* comment here */
$test = $this->testThis(); /* comment here */

$hello ='foo';
;

$sum = $a; /* + $b */
$sum = $a; // + $b

$sum = $a; /* + $b
    + $c */

/*
 * Test that the sniff does *not* throw incorrect errors for semicolons in
 * "empty" parts of a `for` control structure.
 */
for ($i = 1; ; $i++) {}
for ( ;
$ptr >= 0; $ptr-- ) {}
for ( ; ; ) {}

// But it should when the semicolon in a `for` follows a comment (but shouldn't move the semicolon).
for ( /* Deliberately left empty. */; $ptr >= 0; $ptr-- ) {}
for (
$i = 1; /* Deliberately left empty. */; $i++ ) {}

switch (
$foo) {
    case
'foo':
    ;
    break;
}

// This is an empty statement and should be ignored.
if ($foo) {
;
}