-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
1,989 additions
and
916 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"2x":{"Cake\\Chronos\\Chronos":["__construct","toMutable","copy","setTestNow","getTestNow","hasTestNow","createInterval","__debugInfo","checkTypes","__wakeup","__set_state","createFromFormat","getLastErrors","format","getTimezone","getOffset","getTimestamp","diff","modify","add","sub","setTimezone","setTime","setDate","setISODate","setTimestamp","createFromMutable","createFromInterface","getWeekendDays","setWeekendDays","eq","equals","ne","notEquals","gt","greaterThan","gte","greaterThanOrEquals","lt","lessThan","lte","lessThanOrEquals","between","closest","farthest","min","max","isWeekday","isWeekend","isYesterday","isToday","isTomorrow","isNextWeek","isLastWeek","isNextMonth","isLastMonth","isNextYear","isLastYear","isFuture","isPast","isLeapYear","isSameDay","isSunday","isMonday","isTuesday","isWednesday","isThursday","isFriday","isSaturday","isThisWeek","isThisMonth","isThisYear","isBirthday","wasWithinLast","isWithinNext","isMutable","diffInYears","diffInMonths","diffInMonthsIgnoreTimezone","diffInWeeks","diffInDays","diffInDaysFiltered","diffInHoursFiltered","diffFiltered","diffInWeekdays","diffInWeekendDays","diffInHours","diffInMinutes","diffInSeconds","secondsSinceMidnight","secondsUntilEndOfDay","fromNow","diffForHumans","diffFormatter","instance","parse","now","today","tomorrow","yesterday","maxValue","minValue","create","createFromDate","createFromTime","createFromArray","createFromTimestamp","createFromTimestampUTC","resetToStringFormat","setToStringFormat","__toString","toDateString","toFormattedDateString","toTimeString","toDateTimeString","toDayDateTimeString","toAtomString","toCookieString","toIso8601String","toRfc822String","toRfc850String","toRfc1036String","toRfc1123String","toRfc2822String","toRfc3339String","toRssString","toW3cString","toUnixString","toQuarter","toWeek","__get","__isset","getWeekStartsAt","setWeekStartsAt","getWeekEndsAt","setWeekEndsAt","setDateTime","setTimeFromTimeString","timestamp","year","month","day","hour","minute","second","microsecond","addYears","addYear","subYears","subYear","addYearsWithOverflow","addYearWithOverflow","subYearsWithOverflow","subYearWithOverflow","addMonths","addMonth","subMonth","subMonths","addMonthsWithOverflow","addMonthWithOverflow","subMonthsWithOverflow","subMonthWithOverflow","addDays","addDay","subDay","subDays","addWeekdays","addWeekday","subWeekdays","subWeekday","addWeeks","addWeek","subWeek","subWeeks","addHours","addHour","subHour","subHours","addMinutes","addMinute","subMinute","subMinutes","addSeconds","addSecond","subSecond","subSeconds","startOfDay","endOfDay","startOfMonth","endOfMonth","startOfYear","endOfYear","startOfDecade","endOfDecade","startOfCentury","endOfCentury","startOfWeek","endOfWeek","next","previous","firstOfMonth","lastOfMonth","nthOfMonth","firstOfQuarter","lastOfQuarter","nthOfQuarter","firstOfYear","lastOfYear","nthOfYear","average","hasRelativeKeywords","timezone","tz"],"Cake\\Chronos\\ChronosDate":["__construct","toMutable","__debugInfo","create","add","sub","modify","setTimestamp","hour","minute","second","microsecond","__wakeup","__set_state","createFromFormat","getLastErrors","format","getTimezone","getOffset","getTimestamp","diff","setTimezone","setTime","setDate","setISODate","createFromMutable","createFromInterface","getWeekendDays","setWeekendDays","eq","equals","ne","notEquals","gt","greaterThan","gte","greaterThanOrEquals","lt","lessThan","lte","lessThanOrEquals","between","closest","farthest","min","max","isWeekday","isWeekend","isYesterday","isToday","isTomorrow","isNextWeek","isLastWeek","isNextMonth","isLastMonth","isNextYear","isLastYear","isFuture","isPast","isLeapYear","isSameDay","isSunday","isMonday","isTuesday","isWednesday","isThursday","isFriday","isSaturday","isThisWeek","isThisMonth","isThisYear","isBirthday","wasWithinLast","isWithinNext","isMutable","copy","diffInYears","diffInMonths","diffInMonthsIgnoreTimezone","diffInWeeks","diffInDays","diffInDaysFiltered","diffInHoursFiltered","diffFiltered","diffInWeekdays","diffInWeekendDays","diffInHours","diffInMinutes","diffInSeconds","secondsSinceMidnight","secondsUntilEndOfDay","fromNow","diffForHumans","diffFormatter","instance","parse","now","today","tomorrow","yesterday","maxValue","minValue","createFromDate","createFromTime","createFromArray","createFromTimestamp","createFromTimestampUTC","resetToStringFormat","setToStringFormat","__toString","toDateString","toFormattedDateString","toTimeString","toDateTimeString","toDayDateTimeString","toAtomString","toCookieString","toIso8601String","toRfc822String","toRfc850String","toRfc1036String","toRfc1123String","toRfc2822String","toRfc3339String","toRssString","toW3cString","toUnixString","toQuarter","toWeek","timezone","tz","hasRelativeKeywords","__get","__isset","getWeekStartsAt","setWeekStartsAt","getWeekEndsAt","setWeekEndsAt","setDateTime","setTimeFromTimeString","timestamp","year","month","day","addYears","addYear","subYears","subYear","addYearsWithOverflow","addYearWithOverflow","subYearsWithOverflow","subYearWithOverflow","addMonths","addMonth","subMonth","subMonths","addMonthsWithOverflow","addMonthWithOverflow","subMonthsWithOverflow","subMonthWithOverflow","addDays","addDay","subDay","subDays","addWeekdays","addWeekday","subWeekdays","subWeekday","addWeeks","addWeek","subWeek","subWeeks","addHours","addHour","subHour","subHours","addMinutes","addMinute","subMinute","subMinutes","addSeconds","addSecond","subSecond","subSeconds","startOfDay","endOfDay","startOfMonth","endOfMonth","startOfYear","endOfYear","startOfDecade","endOfDecade","startOfCentury","endOfCentury","startOfWeek","endOfWeek","next","previous","firstOfMonth","lastOfMonth","nthOfMonth","firstOfQuarter","lastOfQuarter","nthOfQuarter","firstOfYear","lastOfYear","nthOfYear","average","setTestNow","getTestNow","hasTestNow"]},"3x":{"Cake\\Chronos\\Chronos":["__construct","setTestNow","getTestNow","hasTestNow","hasRelativeKeywords","getWeekendDays","setWeekendDays","getWeekStartsAt","setWeekStartsAt","getWeekEndsAt","setWeekEndsAt","diffFormatter","instance","parse","now","today","tomorrow","yesterday","maxValue","minValue","create","createFromDate","createFromTime","createFromFormat","createFromArray","createFromTimestamp","createFromTimestampUTC","createInterval","setDateTime","setDate","setTime","modify","diff","format","getOffset","setTimestamp","getTimestamp","setTimezone","getTimezone","setTimeFromTimeString","timestamp","year","month","day","hour","minute","second","microsecond","addYears","subYears","addYearsWithOverflow","subYearsWithOverflow","addMonths","subMonths","addMonthsWithOverflow","subMonthsWithOverflow","addDays","subDays","addWeekdays","subWeekdays","addWeeks","subWeeks","addHours","subHours","addMinutes","subMinutes","addSeconds","subSeconds","startOfDay","endOfDay","startOfMonth","endOfMonth","startOfYear","endOfYear","startOfDecade","endOfDecade","startOfCentury","endOfCentury","startOfWeek","endOfWeek","next","previous","firstOfMonth","lastOfMonth","nthOfMonth","firstOfQuarter","lastOfQuarter","nthOfQuarter","firstOfYear","lastOfYear","nthOfYear","equals","notEquals","greaterThan","greaterThanOrEquals","lessThan","lessThanOrEquals","between","closest","farthest","min","max","average","isWeekday","isWeekend","isYesterday","isToday","isTomorrow","isNextWeek","isLastWeek","isNextMonth","isLastMonth","isNextYear","isLastYear","isFuture","isPast","isLeapYear","isSameDay","isSunday","isMonday","isTuesday","isWednesday","isThursday","isFriday","isSaturday","isThisWeek","isThisMonth","isThisYear","isBirthday","wasWithinLast","isWithinNext","diffFiltered","diffInYears","diffInMonths","diffInMonthsIgnoreTimezone","diffInWeeks","diffInDays","diffInDaysFiltered","diffInHoursFiltered","diffInWeekdays","diffInWeekendDays","diffInHours","diffInMinutes","diffInSeconds","secondsSinceMidnight","secondsUntilEndOfDay","fromNow","diffForHumans","__get","__isset","__debugInfo","resetToStringFormat","setToStringFormat","__toString","toDateString","toFormattedDateString","toTimeString","toDateTimeString","toDayDateTimeString","toAtomString","toCookieString","toIso8601String","toRfc822String","toRfc850String","toRfc1036String","toRfc1123String","toRfc2822String","toRfc3339String","toRssString","toW3cString","toUnixString","toQuarter","toWeek"],"Cake\\Chronos\\ChronosDate":["__construct","now","today","tomorrow","yesterday","parse","create","createFromFormat","createFromArray","diffFormatter","add","sub","modify","setDate","diff","format","year","month","day","addYears","subYears","addYearsWithOverflow","subYearsWithOverflow","addMonths","subMonths","addMonthsWithOverflow","subMonthsWithOverflow","addDays","subDays","addWeekdays","subWeekdays","addWeeks","subWeeks","startOfMonth","endOfMonth","startOfYear","endOfYear","startOfDecade","endOfDecade","startOfCentury","endOfCentury","startOfWeek","endOfWeek","next","previous","firstOfMonth","lastOfMonth","nthOfMonth","firstOfQuarter","lastOfQuarter","nthOfQuarter","firstOfYear","lastOfYear","nthOfYear","equals","notEquals","greaterThan","greaterThanOrEquals","lessThan","lessThanOrEquals","between","closest","farthest","isWeekday","isWeekend","isYesterday","isToday","isTomorrow","isNextWeek","isLastWeek","isNextMonth","isLastMonth","isNextYear","isLastYear","isFuture","isPast","isLeapYear","isSunday","isMonday","isTuesday","isWednesday","isThursday","isFriday","isSaturday","wasWithinLast","isWithinNext","diffFiltered","diffInYears","diffInMonths","diffInWeeks","diffInDays","diffInDaysFiltered","diffInWeekdays","diffInWeekendDays","diffForHumans","__get","__isset","__debugInfo","resetToStringFormat","setToStringFormat","__toString","toDateString","toFormattedDateString","toTimeString","toDateTimeString","toDayDateTimeString","toAtomString","toCookieString","toIso8601String","toRfc822String","toRfc850String","toRfc1036String","toRfc1123String","toRfc2822String","toRfc3339String","toRssString","toW3cString","toUnixString","toQuarter","toWeek"]}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
2.4 Upgrade Guide | ||
################# | ||
|
||
Chronos 2.4 introduces a number of deprecations that will help you prepare your | ||
application for the upcoming Chronos 3.x release. This guide covers the | ||
deprecations introduced in 2.4 and gives a preview of what to expect in 3.0. | ||
|
||
No more mutable objects | ||
======================= | ||
|
||
Chronos was an early adopter of PHP's immutable datetime objects. With PHP | ||
moving away from mutable datetime objects both ``Cake\Chronos\MutableDate`` and | ||
``Cake\Chronos\MutaleDateTime`` are deprecated and will be removed in 3.0.0. | ||
|
||
To upgrade, replace usage of ``MutableDate`` with ``ChronosDate`` and | ||
``MutableDateTime`` with ``Chronos``. When modifying datetimes be sure to | ||
always re-assign the variable with the datetime:: | ||
|
||
// Mutate in place | ||
$datetime->modify('+1 days'); | ||
|
||
// Immutable objects must re-assign | ||
$datetime = $datetime->modify('+1 days'); | ||
|
||
ChronosInterface deprecated | ||
=========================== | ||
|
||
Having a consistent interface between date and datetime objects has proven to be | ||
problematic. It created an illusion of compatibility between mutable and | ||
immutable objects and date and datetime objects. Because the | ||
``ChronosInterface`` didn't and can't really deliver on the goals of interfaces | ||
it is deprecated, and will be removed in 3.0. To update your code replace | ||
references to ``ChronosInterface`` with either a reference to | ||
``Cake\Chronos\Chronos`` for datetime instances or ``Cake\Chronos\ChronosDate`` | ||
for date instances. | ||
|
||
Fewer mutation methods | ||
====================== | ||
|
||
For historical reasons the chronos classes included many redundant methods. For | ||
example ``addYear()`` and ``addYears()``. In 2.4.0, all of the singular methods | ||
e.g. ``addYear()`` are deprecated. Instead use the plural versions of the | ||
methods e.g. ``addYears()``. | ||
|
||
Simpler Date class | ||
================== | ||
|
||
When date abstractions were introduced they shared an interfaces with DateTime | ||
classes. This resulted in many no-op methods on dates. For example calling | ||
``setTime()`` on a date would have no effect. In 2.4, all time related methods | ||
(including timezones) are deprecated on date instances. If your application | ||
needs to use the time component of a date, you should use ``Chronos`` instead. | ||
|
||
Upcoming removals in 3.0 | ||
======================== | ||
|
||
The following changes will arrive in 3.0, and don't have a simple deprecation | ||
path. Unfortunately these changes will result in hard breaks in 3.0. | ||
|
||
Carbon aliases removed | ||
---------------------- | ||
|
||
When Chronos was started Carbon had no active maintainers. We included | ||
compatiblity aliases in Chronos to help users migrate from the unmaintained | ||
Carbon library to Chronos. Presently, Carbon has active maintainers and we no | ||
longer feel the need to provide shims. | ||
|
||
No longer extending DateTime | ||
---------------------------- | ||
|
||
Historically Chronos has extended PHP's ``DateTime`` classes. This has proven to | ||
be problematic especially for date classes. While Chronos will not extend | ||
PHP's ``DateTime`` classes or implements the ``DateTimeInterface``, if a method does | ||
not emit a deprecation in 2.4.0 it will continue to work in 3.0. | ||
|
||
To adapt to this change before upgrading to 3.0 replace references to PHP's | ||
``DateTime`` and ``DateTimeInterface`` and use ``Chronos`` or ``ChronosDate`` | ||
instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.