Skip to content

Commit eb7c3a9

Browse files
rodrigoprimojrfnl
authored andcommitted
Generic/EmptyPHPStatement: minor tweaks to test case file
* Updated tests to have more examples with more than one superfluous semicolon. * Minor test comment punctuation tweaks.
1 parent 6105bf7 commit eb7c3a9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.1.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function_call();
1919

2020
?>
2121
<input name="<?php ; something_else(); ?>" />
22-
<input name="<?php something_else(); ; ?>" />
22+
<input name="<?php something_else(); ; ; ?>" />
2323

2424
/*
2525
* Test empty statement: no code between PHP open and close tag.
@@ -42,7 +42,7 @@ function_call();
4242
-->
4343
<?php ; ?>
4444

45-
<input name="<?php ; ?>" /> <!-- Bad. -->
45+
<input name="<?php ;; ?>" /> <!-- Bad. -->
4646

4747
<!-- Tests with short open echo tag. -->
4848
<input name="<?= 'some text' ?>" /> <!-- OK. -->
@@ -53,7 +53,7 @@ function_call();
5353
// Guard against false positives for two consecutive semicolons in a for statement.
5454
for ( $i = 0; ; $i++ ) {}
5555

56-
// Test for useless semicolons
56+
// Test for useless semicolons.
5757
for ( $i = 0; ; $i++ ) {};
5858

5959
if (true) {};
@@ -80,7 +80,7 @@ if ($foo) {
8080
;
8181
}
8282

83-
// Do not remove semicolon after match
83+
// Do not remove semicolon after match.
8484
$c = match ($a) {
8585
1 => true,
8686
};

src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.1.inc.fixed

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function_call();
4848
// Guard against false positives for two consecutive semicolons in a for statement.
4949
for ( $i = 0; ; $i++ ) {}
5050

51-
// Test for useless semicolons
51+
// Test for useless semicolons.
5252
for ( $i = 0; ; $i++ ) {}
5353

5454
if (true) {}
@@ -74,7 +74,7 @@ echo $a{0};
7474
if ($foo) {
7575
}
7676

77-
// Do not remove semicolon after match
77+
// Do not remove semicolon after match.
7878
$c = match ($a) {
7979
1 => true,
8080
};

src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ public function getWarningList($testFile='')
7676
15 => 1,
7777
18 => 1,
7878
21 => 1,
79-
22 => 1,
79+
22 => 2,
8080
31 => 1,
8181
33 => 1,
8282
43 => 1,
83-
45 => 1,
83+
45 => 2,
8484
49 => 1,
8585
50 => 1,
8686
57 => 1,

0 commit comments

Comments
 (0)