Skip to content

0.6.0

Compare
Choose a tag to compare
@BenMorel BenMorel released this 05 Dec 21:59
· 79 commits to master since this release

πŸ’₯ Breaking changes

  • Minimum PHP version is now 8.1
  • DayOfWeek:
    • DayOfWeek is now an enum: constants MONDAY, TUESDAY, etc. are now DayOfWeek instances, not integers
    • the __toString() method is removed, use toString() instead (enums disallow magic methods)
    • the all() method does not accept null anymore, and defaults to DayOfWeek::MONDAY
  • Month:
    • Monthis now an enum: constants JANUARY, FEBRUARY, etc. are now Month instances, not integers
    • the __toString() method is removed, use toString() instead (enums disallow magic methods)

πŸ’© Deprecations

  • DayOfWeek:
    • the of() method is deprecated, use DayOfWeek::from() instead
    • the following methods are deprecated, use enum values instead:
      • DayOfWeek::monday() β†’ DayOfWeek::MONDAY
      • DayOfWeek::tuesday() β†’ DayOfWeek::TUESDAY
      • DayOfWeek::wednesday() β†’ DayOfWeek::WEDNESDAY
      • DayOfWeek::thursday() β†’ DayOfWeek::THURSDAY
      • DayOfWeek::friday() β†’ DayOfWeek::FRIDAY
      • DayOfWeek::saturday() β†’ DayOfWeek::SATURDAY
      • DayOfWeek::sunday() β†’ DayOfWeek::SUNDAY
    • the getValue() method is deprecated, use $dayOfWeek->value instead
    • the is() method is deprecated, compare values with $dayOfWeek->value instead
    • the isEqualTo() method is deprecated, use strict equality === between DayOfWeek instances instead.
  • LocalDate:
    • getDay() is deprecated, use getDayOfMonth() instead
    • getMonth() is deprecated, use getMonthValue() instead (getMonth() will be repurposed to return a Month instance in a future release)
  • LocalDateTime:
    • getDay() is deprecated, use getDayOfMonth() instead
    • getMonth() is deprecated, use getMonthValue() instead (getMonth() will be repurposed to return a Month instance in a future release)
  • Month:
    • the of() method is deprecated, use Month::from() instead
    • the getAll() method is deprecated, use Month::cases() instead
    • the getValue() method is deprecated, use $month->value instead
    • the is() method is deprecated, compare values with $month->value instead
    • the isEqualTo() method is deprecated, use strict equality === between Month instances instead
  • MonthDay:
    • getDay() is deprecated, use getDayOfMonth() instead
    • getMonth() is deprecated, use getMonthValue() instead (getMonth() will be repurposed to return a Month instance in a future release)
  • YearMonth:
    • getMonth() is deprecated, use getMonthValue() instead (getMonth() will be repurposed to return a Month instance in a future release)
  • YearWeek:
    • the atDay() method now accepts a DayOfWeek instance, passing an integer is deprecated
  • ZonedDateTime:
    • getDay() is deprecated, use getDayOfMonth() instead
    • getMonth() is deprecated, use getMonthValue() instead (getMonth() will be repurposed to return a Month instance in a future release)