Skip to content

Commit 3421e00

Browse files
committed
Apply whitespace changes from phpcbf
1 parent bccdffc commit 3421e00

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed

src/Config.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,20 +1686,24 @@ private function parseSniffCodes($input, $argument)
16861686
}
16871687
}//end foreach
16881688

1689-
$sniffs = array_reduce($sniffs, static function ($carry, $item) {
1690-
$lower = strtolower($item);
1691-
1692-
foreach ($carry as $found) {
1693-
if ($lower === strtolower($found)) {
1694-
// This sniff is already in our list.
1695-
return $carry;
1689+
$sniffs = array_reduce(
1690+
$sniffs,
1691+
static function ($carry, $item) {
1692+
$lower = strtolower($item);
1693+
1694+
foreach ($carry as $found) {
1695+
if ($lower === strtolower($found)) {
1696+
// This sniff is already in our list.
1697+
return $carry;
1698+
}
16961699
}
1697-
}
16981700

1699-
$carry[] = $item;
1701+
$carry[] = $item;
17001702

1701-
return $carry;
1702-
}, []);
1703+
return $carry;
1704+
},
1705+
[]
1706+
);
17031707

17041708
if ($errors !== []) {
17051709
$error = 'ERROR: The --'.$argument.' option only supports sniff codes.'.PHP_EOL;

tests/Core/Config/SniffsExcludeArgsTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,25 +81,25 @@ public static function dataInvalidSniffs()
8181
foreach ($arguments as $argument) {
8282
// Empty values are errors.
8383
$data[$argument.'; empty string'] = [
84-
'argument' => $argument,
85-
'value' => '',
86-
'errors' => [
84+
'argument' => $argument,
85+
'value' => '',
86+
'errors' => [
8787
'No codes specified / empty argument',
8888
],
8989
'suggestion' => null,
9090
];
9191
$data[$argument.'; one comma alone'] = [
92-
'argument' => $argument,
93-
'value' => ',',
94-
'errors' => [
92+
'argument' => $argument,
93+
'value' => ',',
94+
'errors' => [
9595
'No codes specified / empty argument',
9696
],
9797
'suggestion' => null,
9898
];
9999
$data[$argument.'; two commas alone'] = [
100-
'argument' => $argument,
101-
'value' => ',,',
102-
'errors' => [
100+
'argument' => $argument,
101+
'value' => ',,',
102+
'errors' => [
103103
'No codes specified / empty argument',
104104
],
105105
'suggestion' => null,
@@ -229,7 +229,7 @@ public static function dataValidSniffs()
229229
];
230230

231231
// Rogue commas are quietly ignored.
232-
$data[$argument.'; trailing comma'] = [
232+
$data[$argument.'; trailing comma'] = [
233233
'argument' => $argument,
234234
'value' => 'Standard.Category.Sniff,',
235235
'result' => ['Standard.Category.Sniff'],

0 commit comments

Comments
 (0)