Skip to content

Commit

Permalink
Do not sort
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 14, 2024
1 parent b36a500 commit 2e084f3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions src/Target/MapBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use function array_merge;
use function array_unique;
use function range;
use function sort;
use SebastianBergmann\CodeCoverage\Filter;
use SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser;

Expand Down Expand Up @@ -104,8 +103,6 @@ public function build(Filter $filter, FileAnalyser $analyser): array
foreach (array_keys($namespaces) as $namespace) {
foreach (array_keys($namespaces[$namespace]) as $file) {
$namespaces[$namespace][$file] = array_unique($namespaces[$namespace][$file]);

sort($namespaces[$namespace][$file]);
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/Target/Mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use function array_merge;
use function array_unique;
use function sort;

/**
* @phpstan-type TargetMap array{namespaces: TargetMapPart, classes: TargetMapPart, classesThatExtendClass: TargetMapPart, classesThatImplementInterface: TargetMapPart, traits: TargetMapPart, methods: TargetMapPart, functions: TargetMapPart, reverseLookup: ReverseLookup}
Expand Down Expand Up @@ -55,8 +54,6 @@ public function mapTargets(TargetCollection $targets): array
}

$result[$file] = array_unique(array_merge($result[$file], $lines));

sort($result[$file]);
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/tests/Target/MapBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public function testBuildsMap(): void
'namespaces' => [
'SebastianBergmann\\CodeCoverage\\StaticAnalysis' => [
$file => array_merge(
range(19, 24),
range(26, 31),
range(33, 52),
range(19, 24),
range(54, 56),
),
],
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/Target/MapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public static function provider(): array
'namespace' => [
[
$file => array_merge(
range(19, 24),
range(26, 31),
range(33, 52),
range(19, 24),
range(54, 56),
),
],
Expand Down

0 comments on commit 2e084f3

Please sign in to comment.