Skip to content

Commit 24fffe8

Browse files
committed
Use semicolon for empty foreach
1 parent 8c63333 commit 24fffe8

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

benchmark/BSON/DocumentBench.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,18 @@ public function benchToPHPArray(): void
8080
public function benchIteration(): void
8181
{
8282
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedForeach
83-
foreach (self::getBSONDocument() as $key => $value) {
84-
}
83+
foreach (self::getBSONDocument() as $key => $value);
8584
}
8685

8786
public function benchIterationAsArray(): void
8887
{
8988
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedForeach
90-
foreach (self::getBSONDocument()->toPHP(['root' => 'array']) as $key => $value) {
91-
}
89+
foreach (self::getBSONDocument()->toPHP(['root' => 'array']) as $key => $value);
9290
}
9391

9492
public function benchIterationAsObject(): void
9593
{
9694
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedForeach
97-
foreach (self::getBSONDocument()->toPHP() as $key => $value) {
98-
}
95+
foreach (self::getBSONDocument()->toPHP() as $key => $value);
9996
}
10097
}

benchmark/BSON/PackedArrayBench.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,18 @@ public function benchToPHPArray(): void
8383
public function benchIteration(): void
8484
{
8585
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedForeach
86-
foreach (self::getBSONArray() as $key => $value) {
87-
}
86+
foreach (self::getBSONArray() as $key => $value);
8887
}
8988

9089
public function benchIterationAfterIteratorToArray(): void
9190
{
9291
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedForeach
93-
foreach (iterator_to_array(self::getBSONArray()) as $key => $value) {
94-
}
92+
foreach (iterator_to_array(self::getBSONArray()) as $key => $value);
9593
}
9694

9795
public function benchIterationAsArray(): void
9896
{
9997
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedForeach
100-
foreach (self::getBSONArray()->toPHP() as $key => $value) {
101-
}
98+
foreach (self::getBSONArray()->toPHP() as $key => $value);
10299
}
103100
}

0 commit comments

Comments
 (0)