Skip to content

Commit

Permalink
Merge pull request #79 from PHPCSStandards/feature/ruleset-explain-us…
Browse files Browse the repository at this point in the history
…e-natural-sort

Ruleset::explain(): use natural sorting
  • Loading branch information
jrfnl authored Dec 4, 2023
2 parents 16db52c + 631f16a commit 11d5c66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ The file documents changes to the PHP_CodeSniffer project.
- Thanks to @Daimona for the patch
- Runtime performance improvement for PHPCS CLI users. The improvement should be most noticeable for users on Windows.
- Thanks to Juliette Reinders Folmer (@jrfnl) for the patch
- The -e (explain) command will now list sniffs in natural order
- Thanks to Juliette Reinders Folmer (@jrfnl) for the patch

### Removed
- Removed support for installing via PEAR
Expand Down
2 changes: 1 addition & 1 deletion src/Ruleset.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public function __construct(Config $config)
public function explain()
{
$sniffs = array_keys($this->sniffCodes);
sort($sniffs);
sort($sniffs, (SORT_NATURAL | SORT_FLAG_CASE));

$sniffCount = count($sniffs);

Expand Down

0 comments on commit 11d5c66

Please sign in to comment.