0.6.0
π₯ Breaking changes
- Minimum PHP version is now 8.1
DayOfWeek
:DayOfWeek
is now anenum
: constantsMONDAY
,TUESDAY
, etc. are nowDayOfWeek
instances, not integers- the
__toString()
method is removed, usetoString()
instead (enums disallow magic methods) - the
all()
method does not acceptnull
anymore, and defaults toDayOfWeek::MONDAY
Month
:Month
is now anenum
: constantsJANUARY
,FEBRUARY
, etc. are nowMonth
instances, not integers- the
__toString()
method is removed, usetoString()
instead (enums disallow magic methods)
π© Deprecations
DayOfWeek
:- the
of()
method is deprecated, useDayOfWeek::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===
betweenDayOfWeek
instances instead.
- the
LocalDate
:getDay()
is deprecated, usegetDayOfMonth()
insteadgetMonth()
is deprecated, usegetMonthValue()
instead (getMonth()
will be repurposed to return aMonth
instance in a future release)
LocalDateTime
:getDay()
is deprecated, usegetDayOfMonth()
insteadgetMonth()
is deprecated, usegetMonthValue()
instead (getMonth()
will be repurposed to return aMonth
instance in a future release)
Month
:- the
of()
method is deprecated, useMonth::from()
instead - the
getAll()
method is deprecated, useMonth::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===
betweenMonth
instances instead
- the
MonthDay
:getDay()
is deprecated, usegetDayOfMonth()
insteadgetMonth()
is deprecated, usegetMonthValue()
instead (getMonth()
will be repurposed to return aMonth
instance in a future release)
YearMonth
:getMonth()
is deprecated, usegetMonthValue()
instead (getMonth()
will be repurposed to return aMonth
instance in a future release)
YearWeek
:- the
atDay()
method now accepts aDayOfWeek
instance, passing an integer is deprecated
- the
ZonedDateTime
:getDay()
is deprecated, usegetDayOfMonth()
insteadgetMonth()
is deprecated, usegetMonthValue()
instead (getMonth()
will be repurposed to return aMonth
instance in a future release)