Skip to content

Commit ed08850

Browse files
committed
Merge branch 'php-8.0/generic-scopeindent-support-match' of https://github.com/jrfnl/PHP_CodeSniffer
2 parents 1106d65 + 19b401a commit ed08850

File tree

5 files changed

+114
-2
lines changed

5 files changed

+114
-2
lines changed

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,33 @@ class Foo
14761476
}
14771477
}
14781478

1479+
$value = match ($value) {
1480+
'' => null,
1481+
false => false,
1482+
1, 2, 3 => true,
1483+
default => $value,
1484+
};
1485+
1486+
$value = match ($value) {
1487+
'' => null,
1488+
false => false,
1489+
1, 2, 3 => true,
1490+
default => $value,
1491+
};
1492+
1493+
$value = match (
1494+
$value
1495+
) {
1496+
'' => null,
1497+
false
1498+
=> false,
1499+
1,
1500+
2,
1501+
3 => true,
1502+
default =>
1503+
$value,
1504+
};
1505+
14791506
/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */
14801507
?>
14811508

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,33 @@ class Foo
14761476
}
14771477
}
14781478

1479+
$value = match ($value) {
1480+
'' => null,
1481+
false => false,
1482+
1, 2, 3 => true,
1483+
default => $value,
1484+
};
1485+
1486+
$value = match ($value) {
1487+
'' => null,
1488+
false => false,
1489+
1, 2, 3 => true,
1490+
default => $value,
1491+
};
1492+
1493+
$value = match (
1494+
$value
1495+
) {
1496+
'' => null,
1497+
false
1498+
=> false,
1499+
1,
1500+
2,
1501+
3 => true,
1502+
default =>
1503+
$value,
1504+
};
1505+
14791506
/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */
14801507
?>
14811508

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,33 @@ class Foo
14761476
}
14771477
}
14781478

1479+
$value = match ($value) {
1480+
'' => null,
1481+
false => false,
1482+
1, 2, 3 => true,
1483+
default => $value,
1484+
};
1485+
1486+
$value = match ($value) {
1487+
'' => null,
1488+
false => false,
1489+
1, 2, 3 => true,
1490+
default => $value,
1491+
};
1492+
1493+
$value = match (
1494+
$value
1495+
) {
1496+
'' => null,
1497+
false
1498+
=> false,
1499+
1,
1500+
2,
1501+
3 => true,
1502+
default =>
1503+
$value,
1504+
};
1505+
14791506
/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */
14801507
?>
14811508

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,33 @@ class Foo
14761476
}
14771477
}
14781478

1479+
$value = match ($value) {
1480+
'' => null,
1481+
false => false,
1482+
1, 2, 3 => true,
1483+
default => $value,
1484+
};
1485+
1486+
$value = match ($value) {
1487+
'' => null,
1488+
false => false,
1489+
1, 2, 3 => true,
1490+
default => $value,
1491+
};
1492+
1493+
$value = match (
1494+
$value
1495+
) {
1496+
'' => null,
1497+
false
1498+
=> false,
1499+
1,
1500+
2,
1501+
3 => true,
1502+
default =>
1503+
$value,
1504+
};
1505+
14791506
/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */
14801507
?>
14811508

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,14 @@ public function getErrorList($testFile='ScopeIndentUnitTest.inc')
178178
1340 => 1,
179179
1342 => 1,
180180
1345 => 1,
181-
1487 => 1,
182181
1488 => 1,
183182
1489 => 1,
184-
1490 => 1,
183+
1500 => 1,
184+
1503 => 1,
185+
1514 => 1,
186+
1515 => 1,
187+
1516 => 1,
188+
1517 => 1,
185189
];
186190

187191
}//end getErrorList()

0 commit comments

Comments
 (0)