We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dirctories should be shown in alphabetical order. In the screenshot, EntityRepository comes before Entity but it should be after.
EntityRepository
Entity
The text was updated successfully, but these errors were encountered:
Would this help?
diff --git a/src/Report/Html/Renderer/Directory.php b/src/Report/Html/Renderer/Directory.php index 1d7334b3..850f0a53 100644 --- a/src/Report/Html/Renderer/Directory.php +++ b/src/Report/Html/Renderer/Directory.php @@ -15,6 +15,7 @@ use SebastianBergmann\CodeCoverage\FileCouldNotBeWrittenException; use SebastianBergmann\CodeCoverage\Node\AbstractNode as Node; use SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode; +use SebastianBergmann\CodeCoverage\Node\File as FileNode; use SebastianBergmann\Template\Exception; use SebastianBergmann\Template\Template; @@ -32,11 +33,29 @@ public function render(DirectoryNode $node, string $file): void $items = $this->renderItem($node, true); - foreach ($node->directories() as $item) { + $directories = $node->directories(); + + usort( + $directories, + static function (DirectoryNode $a, DirectoryNode $b) { + return $a->name() <=> $b->name(); + } + ); + + foreach ($directories as $item) { $items .= $this->renderItem($item); } - foreach ($node->files() as $item) { + $files = $node->files(); + + usort( + $files, + static function (FileNode $a, FileNode $b) { + return $a->name() <=> $b->name(); + } + ); + + foreach ($files as $item) { $items .= $this->renderItem($item); }
Sorry, something went wrong.
No branches or pull requests
Dirctories should be shown in alphabetical order. In the screenshot,
EntityRepository
comes beforeEntity
but it should be after.The text was updated successfully, but these errors were encountered: