Skip to content

Report info: minor sorting improvement #2119

New issue

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

Merged

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Aug 12, 2018

Just realized that I hadn't added this to the previous PR #2103 yet.

As the metric keys may be numeric, the SORT_NATURAL flag (introduced in PHP 5.4) will ensure that numbers with equal counts will be sorted properly, i.e.:
Without this these would be sorted like:

1  => 10 (... %)
12 => 10 (... %)
2  => 10 (... %)

Now they will be sorted like so:

1  => 10 (... %)
2  => 10 (... %)
12 => 10 (... %)

Just realized that I hadn't added this to the previous PR 2103 yet.

As the metric keys may be numeric, the `SORT_NATURAL` flag (introduced in PHP 5.4) will ensure that numbers with equal counts will be sorted properly, i.e.:
Without this these would be sorted like:
```
1  => 10 (... %)
12 => 10 (... %)
2  => 10 (... %)
```
Now they will be sorted like so:
```
1  => 10 (... %)
2  => 10 (... %)
12 => 10 (... %)
```
@gsherwood gsherwood added this to the 3.3.2 milestone Aug 14, 2018
@gsherwood
Copy link
Member

Thanks

@gsherwood gsherwood merged commit 62b4a76 into squizlabs:master Aug 14, 2018
@jrfnl jrfnl deleted the feature/report-info-minor-sorting-fix branch August 14, 2018 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants