Skip to content
This repository was archived by the owner on Feb 21, 2022. It is now read-only.

Commit 7774046

Browse files
committed
Add subgroups test & fix rebase conflict
1 parent a1751a6 commit 7774046

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/PHPFormatter/Sorter/UseSorter.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,6 @@ public function sort($data)
245245
} else {
246246
$groups[$groupKey] = $this->sortGroup($group);
247247
}
248-
249-
$groups[$groupKey] = $this->sortGroup($group);
250248
}
251249

252250
$doubleEOL = PHP_EOL . PHP_EOL;

tests/PHPFormatter/Sorter/UseSorterTest.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,25 @@ public function dataSort()
314314
use Test3\\File;
315315
use Test3\\MyFolder\\Myclass;
316316
"
317-
)
317+
),
318+
array(
319+
['Test2', ['Test1\MyFolder5', 'Test1'], '_main'],
320+
UseSorter::SORT_TYPE_ALPHABETIC,
321+
UseSorter::SORT_DIRECTION_ASC,
322+
UseSorter::GROUP_TYPE_EACH,
323+
"
324+
use Test2\\Myclass3;
325+
use Test2\\Myclass4;
326+
327+
use Test1\\MyFolder5\\File as MyFile;
328+
use Test1\\Myclass1;
329+
use Test1\\Myclass2;
330+
331+
use Test3\\File;
332+
use Test3\\MyFolder\\Myclass;
333+
use Test4\\Myclass3;
334+
"
335+
),
318336
);
319337
}
320338

0 commit comments

Comments
 (0)