Working with durations made easy
Added support for all PHP 8.x versions
Added support for PHP 8.0
Duration
now extends DateInterval
and can be used interchangeably.__toString()
method are now supported values.Duration::toDateInterval()
is now deprecated.0
, null
, false
, true
are now supported values as in that they result in Duration::none()
(PT0S
).InvalidDuration
error will be thrown if a value is given without a unit or if the given value cannot be parsed.toIntervalSpec()
did more than it needed to do. Instead of formatting the current value the spec itself is now returned.New DateTimeImmutable
instances ignore timezones when created #3
The Duration
class is final again (and will stay that way) #2
The Duration
class is now extensible instead of macroable.
Gamez\Duration\DurationException
Gamez\Duration\Exception\InvalidDuration
Fixed errors in the documentation. Nobody likes errors in the documentation :).
Initial release