kevinkhill / php-duration

Convert durations of time between colon-formatted, human-readable, and seconds
MIT License
158 stars 26 forks source link

Fix bug with formatting zero duration #14

Closed pulzarraider closed 5 years ago

pulzarraider commented 5 years ago

... and replace is_null with null comparison for better performance.

This PR fixes this bug in code

$duration = new Duration($value);
$value = $duration->formatted(null, true);

If $value is 0 the output is wrong: 0:00:

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.8%) to 96.552% when pulling 162c2b85decea68c11ff8660459381c37a4cb96c on pulzarraider:zerofill_fix into 190639f4f734b6310f5ff238040f0325e5567ecc on kevinkhill:master.

kevinkhill commented 5 years ago

Nice catch, thanks!

pulzarraider commented 5 years ago

@kevinkhill thank you for fast merge.

kevinkhill commented 5 years ago

I use IFTTT to push notifications to my phone when I get PRs

pulzarraider commented 5 years ago

@kevinkhill can you please tag master?