Skip to content

Commit f8de883

Browse files
Eliminate code duplication
1 parent 14aa0ce commit f8de883

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/TextUI/Command/Commands/ListGroupsCommand.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,12 @@ public function execute(): Result
4444

4545
foreach ($this->tests as $test) {
4646
if ($test instanceof PhptTestCase) {
47-
if (!isset($groups['default'])) {
48-
$groups['default'] = 1;
49-
} else {
50-
$groups['default']++;
51-
}
52-
53-
continue;
47+
$_groups = ['default'];
48+
} else {
49+
$_groups = $test->groups();
5450
}
5551

56-
foreach ($test->groups() as $group) {
52+
foreach ($_groups as $group) {
5753
if (!isset($groups[$group])) {
5854
$groups[$group] = 1;
5955
} else {

0 commit comments

Comments
 (0)