Skip to content

Conversation

Kovah
Copy link
Contributor

@Kovah Kovah commented Nov 1, 2016

Updates the convertFromMinutes() functions inside Game and Item classes to use the plural version of days, hours and minutes only if the value is > 1

@stygiansabyss
Copy link
Contributor

This might be better served using Str::plural from laravel. As it stands now, zero has not been accounted for. I don't think we could guarantee that minutes would never be zero.

@Kovah
Copy link
Contributor Author

Kovah commented Nov 1, 2016

I agree with adding a check for the value of minutes.
But I think replacing this simple PHP line with Str::plural() is a little bit "overkill" as the used words are static. Calling a facade, loading different classes which are using caches to determine the correct plural form of a word, instead of a single if/else condition.

@stygiansabyss stygiansabyss merged commit 5033a09 into syntaxerrors:master Feb 3, 2017
@stygiansabyss
Copy link
Contributor

The main reason I was hesitant until I could make changes is that your example has a flaw. When you have zero of an item you also pluralize it. So instead of greater than one gets pluralized its actually only one that doesn't.

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