The French have a concept of strictly positive and strictly negative, which match the common English definition, which excludes zero. Interesting to note, the docblock of the class itself does not acknowledge zero, since May be positive or negative seems to suggest that zero is not an option.
/**
* Represents a time interval (a specific number of hours, minutes, seconds, and
* nanoseconds). May be positive or negative. All instances are immutable.
May I suggest adding ->isPositiveOrZero() and ->isNegativeOrZero(). Not because ->isPositive() || ->isZero() or !->isNegative() is to hard to write, but as a reminder to programmers who navigate autocomplete to think about what to do with zero. This small reminder might make a large difference.
I believe this might be a language thing. I do not know if this is confusing to others. This might be very be a European thing.
The French have a concept of strictly positive and strictly negative, which match the common English definition, which excludes zero. Interesting to note, the docblock of the class itself does not acknowledge zero, since
May be positive or negative
seems to suggest that zero is not an option.May I suggest adding
->isPositiveOrZero()
and->isNegativeOrZero()
. Not because->isPositive() || ->isZero()
or!->isNegative()
is to hard to write, but as a reminder to programmers who navigate autocomplete to think about what to do with zero. This small reminder might make a large difference.