Skip to content

Release 1.0.0

Latest

Choose a tag to compare

@brzuchal brzuchal released this 22 Nov 23:34
· 3 commits to 1.1 since this release
v1.0.0

Breaking Changes

  • Duration Refactoring:
    • Duration is now strictly time-based (hours, minutes, seconds, nanos).
    • Removed years, months, days properties and factory methods from Duration.
    • Removed LocalDate::plusDuration() and LocalDate::minusDuration(). Use plusPeriod() instead.

New Features

  • Period:
    • Introduced Period class for date-based amounts (years, months, days).
    • Added LocalDate::plusPeriod() and LocalDate::minusPeriod().
    • Added LocalDateTime::plusPeriod() and LocalDateTime::minusPeriod().
  • LocalDateTimeDelta:
    • Introduced LocalDateTimeDelta value object combining Period and Duration.
    • Supports full ISO-8601 duration parsing (e.g., P1Y2M3DT4H5M6S).
    • Added LocalDateTime::plusDelta() and LocalDateTime::minusDelta().
  • ISO-8601 Parsing:
    • Centralized ISO-8601 parsing logic in Iso8601Parser.
    • Unified parsing behavior across Period, Duration, and LocalDateTimeDelta.

Improvements

  • Introduced a LocalTime value object with validation, arithmetic helpers, and TemporalAccessor integration.
  • Add InvalidTime exception for clearer range violations.
  • Add LocalDateTime aggregate covering combined date/time arithmetic, Instant conversion, and TemporalAccessor support.

All tests passing (262 tests, 516 assertions). PHPStan level max: No errors.