Skip to content

Commit 11d5c66

Browse files
authored
Merge pull request #79 from PHPCSStandards/feature/ruleset-explain-use-natural-sort
Ruleset::explain(): use natural sorting
2 parents 16db52c + 631f16a commit 11d5c66

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ The file documents changes to the PHP_CodeSniffer project.
8383
- Thanks to @Daimona for the patch
8484
- Runtime performance improvement for PHPCS CLI users. The improvement should be most noticeable for users on Windows.
8585
- Thanks to Juliette Reinders Folmer (@jrfnl) for the patch
86+
- The -e (explain) command will now list sniffs in natural order
87+
- Thanks to Juliette Reinders Folmer (@jrfnl) for the patch
8688

8789
### Removed
8890
- Removed support for installing via PEAR

src/Ruleset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public function __construct(Config $config)
238238
public function explain()
239239
{
240240
$sniffs = array_keys($this->sniffCodes);
241-
sort($sniffs);
241+
sort($sniffs, (SORT_NATURAL | SORT_FLAG_CASE));
242242

243243
$sniffCount = count($sniffs);
244244

0 commit comments

Comments
 (0)