Skip to content

Commit ad97d0c

Browse files
committed
PHP 8.0 | PEAR/ScopeClosingBrace: add tests with match control structure
1 parent 8b0137a commit ad97d0c

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,11 @@ switch ( $a ) {
144144
?>
145145
<?php $_cartQty = $this->getSummaryCount(); ?>
146146
<div id="minicart" <?php if ($_cartQty == 0): ?>class="empty"<?php endif; ?>>
147+
148+
<?php
149+
$match = match ($test) { 1 => 'a', 2 => 'b' };
150+
151+
$match = match ($test) {
152+
1 => 'a',
153+
2 => 'b'
154+
};

src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc.fixed

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,12 @@ switch ( $a ) {
148148
<?php $_cartQty = $this->getSummaryCount(); ?>
149149
<div id="minicart" <?php if ($_cartQty == 0): ?>class="empty"<?php
150150
endif; ?>>
151+
152+
<?php
153+
$match = match ($test) { 1 => 'a', 2 => 'b'
154+
};
155+
156+
$match = match ($test) {
157+
1 => 'a',
158+
2 => 'b'
159+
};

src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public function getErrorList()
4040
135 => 1,
4141
141 => 1,
4242
146 => 1,
43+
149 => 1,
44+
154 => 1,
4345
];
4446

4547
}//end getErrorList()

0 commit comments

Comments
 (0)