Skip to content
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

Fix order of tags with the same number of occurrences #1143

Merged
merged 2 commits into from Jun 4, 2018

Conversation

ArthurHoaro
Copy link
Member

Fixes #1142

@ArthurHoaro ArthurHoaro added this to the 0.10.0 milestone May 19, 2018
@ArthurHoaro ArthurHoaro self-assigned this May 19, 2018
@@ -458,8 +458,10 @@ public function linksCountPerTag($filteringTags = [], $visibility = 'all')
$tags[$caseMapping[strtolower($tag)]]++;
}
}
// Sort tags by usage (most used tag first)
arsort($tags);
$keys = array_keys($tags);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be worth testing and documenting for future reference (e.g. when we drop PHP 5.6 support)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, this method doesn't seem to be tested.

Before this, linksCountPerTag call without would have ignored visibility parameter
@ArthurHoaro ArthurHoaro merged commit 17e45b2 into shaarli:master Jun 4, 2018
@ArthurHoaro ArthurHoaro deleted the sort-equal-tags branch June 4, 2018 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants