Releases: thephpleague/period
Releases · thephpleague/period
version 5.3.3
version 5.3.2
Added
- None
Fixed
- Fix package to avoid PHP8.4 deprecation warnings
Deprecated
- None
Removed
- None
version 5.3.1
version 5.3.0
Added
Chart\LetterCase::convert
Fixed
- Handles gracefully new Date exception in PHP8.3
Deprecated
- None
Removed
- None
version 5.2.1
Added
- None
Fixed
Period::fromRangeshould work in PHP8.1 withDatePeriodlimitations.
Deprecated
InitialDatePresenceuse insteadPeriod::fromRange
Removed
- None
version 5.2.0
Added
Period::rangeForwardallows iteration over a set of dates and times, recurring at regular intervals, over the instance forward starting from the instance start.Period::rangeBackwardsAllows iteration over a set of dates and times, recurring at regular intervals, over the instance backwards starting from the instance ending.Period::fromRangereturns a newPeriodinstance from aDatePeriodobject. Only usable in PHP8.2+ installation
Fixed
- Using PHPUnit 10 instead of PHPUnit 9.
Deprecated
Period::dateRangeForwarduse insteadPeriod::rangeForwardPeriod::dateRangeBackwardsuse insteadPeriod::rangeBackwards
Removed
- None
version 5.1.0
Added
DatePoint::fromFormatto instantiate from a date format and its related string.
Fixed
Period::fromIso8601now supports truncated date and duration in the interval string.
Deprecated
- None
Removed
- None
version 5.0.0
Added
IntervalErrorused as the error interface marker.InvalidIntervalexception for anything regarding creating an object.Duration::fromSecondsuses a dedicated fraction parameter and the seconds are no longer expressed using afloatvalue.Period::fromTimestampto instantiate a time range object from two timestamps.Period::fromIso80000to instantiate a time range object from a mathematical representation and a date format.Period::fromBourbakito instantiate a time range object from a mathematical representation and a date format.Periodduration comparison methods accepts alsoDurationandDateIntervalin addition toPeriodobjects.Period::unionPeriod::snapTo*methods to ease period expansion.Period::meetsPeriod::meetsOnStartPeriod::meetsOnEndPeriod::toBourbakiPeriod::toIso80000Period::toBourbakiBoundsEnumeration.InitialDatePresenceEnumeration.Sequence::toListChart\LetterCaseEnumeration.Chart\AlignmentEnumeration.Chart\StreamOutputclass to replaceChart\ConsoleOutputclass.Chart\TerminalEnumeration.Chart\ChartErrorused as the chart error interface marker.Chart\UnableToDrawChartexception for anything regarding drawing a chart out ofPeriodand/orSequenceobjects.
Fixed
- Switch from using
Closureobject instead of thecallablepseudo type with theSequencemethods. Period::diffreturns aSequenceinstance instead of an array.Period::__constructis private.Periodnamed constructors, all parameters are required except for the boundaries.Period::timeDurationnow returns anintinstead of afloatvalue.Period::intersectnow can take multiplePeriodinstances as parameters.Period::subtractnow can take multiplePeriodinstances as parameters.Durationno longer extends aDateIntervalobject.Duration::fromIsoStringsupports 3 versions of dealing with fractions with ISO valid string.Datepointclass renamedDatePoint.DatePointno longer extends aDateTimeImmutableobject.- Argument names are normalized throughout the package. (PHP8 BC break)
Chart\LatinLetterin case of wrong value will fall back toAinstead of0which is not a letter.Chart\LatinLetterthe starting label must be explicit on instantiation.Chart\RomanNumberrequires its two arguments to be explicitly set.
Deprecated
- None
Removed
- Support for PHP7 and PHP8.0
Period::fromDatepointreplaced byPeriod::fromDatePeriod::getStartDatereplaced by accessing readonly propertyPeriod::startDatePeriod::getEndDatereplaced by accessing readonly propertyPeriod::endDatePeriod::getBoundaryTypereplaced by accessing readonly propertyPeriod::boundsPeriod::getDateIntervalreplaced byPeriod::dateIntervalPeriod::getTimestampIntervalreplaced byPeriod::timeDurationPeriod::withBoundaryTypereplaced byPeriod::boundedByPeriod::isStartIncludedwith no replacement useBounds::isStartIncludedPeriod::isStartExcludedwith no replacement useBounds::isStartIncludedinsteadPeriod::isEndIncludedwith no replacement useBounds::isEndIncludedPeriod::isEndExcludedwith no replacement useBounds::isEndIncludedinsteadPeriod::fromDatePeriodreplaced byPeriod::fromDateRangePeriod::getDatePeriodreplaced byPeriod::dateRangePeriod::getDatePeriodBackwardsreplaced byPeriod::dateRangeBackwardsPeriod::__stringreplaced byPeriod::toIso8601Period::formatreplaced byPeriod::toIso80000Period::splitreplaced byPeriod::splitForwardPeriod::substractusePeriod::subtractinsteadSequence::substractuseSequence::subtractinsteadSequence::getIntersectionsuseSequence::intersectionsinsteadSequence::getGapsuseSequence::gapsinsteadSequence::getBoundariesuseSequence::lengthinsteadSequence::getTotalTimestampIntervaluseSequence::totalTimeDurationinsteadSequence::toArrayuseSequence::toListinsteadDuration::__toStringandDuration::formatwith no replacementDuration::createis removed with no replacementDatepoint::createis removed with no replacement- The
createprefix is removed from theDurationandDatepointnamed constructors. - All charts related classes have their properties exposed as public readonly. All their getters are removed except if they are part of an interface.
Chart\ConsoleOutputreplaced byChart\StreamOutputclass.Chart\RomanNumber::isLoweruseChart\LetterCase::isUpperinstead.Chart\RomanNumber::startingAtuseChart\DecimalNumber::startLabelpublic readonly propertyChart\RomanNumber::startsWithis removed with no replacementChart\RomanNumber::withLetterCaseis removed with no replacementChart\DecimalNumber::startsWithis removed with no replacementChart\LatinNumber::startsWithis removed with no replacementChart\LatinNumber::startingAtuseChart\LatinNumber::startLabelpublic readonly propertyChart\AffixLabel::withPrefixis removed with no replacementChart\AffixLabel::withSuffixis removed with no replacementChart\AffixLabel::prefixmethod useChart\AffixLabel::labelPrefixpublic readonly propertyChart\AffixLabel::suffixmethod useChart\AffixLabel::labelSuffixpublic readonly property
Removed all the following namespaced functions from the package:
League\Period\datepointLeague\Period\durationLeague\Period\yearLeague\Period\semesterLeague\Period\quarterLeague\Period\monthLeague\Period\dayLeague\Period\hourLeague\Period\minuteLeague\Period\secondLeague\Period\instantLeague\Period\iso_yearLeague\Period\iso_weekLeague\Period\interval_afterLeague\Period\interval_beforeLeague\Period\interval_aroundLeague\Period\interval_from_dateperiod
version 4.12.0
Added
Datepoint::secondDatepoint::minuteDatepoint::hourDatepoint::isoWeekDatepoint::monthDatepoint::quarterDatepoint::semesterDatepoint::yearDatepoint::isoYearDuration::fromDateIntervalDuration::fromSecondsDuration::fromChronoStringDuration::fromTimeStringDuration::fromDateStringPeriod::timeDurationPeriod::dateIntervalPeriod::dateRangeForwardPeriod::dateRangeBackwardsPeriod::toIso80000Period::splitForwardPeriod::timeDurationDiffPeriod::boundedBySequence::lengthSequence::totalTimeDuration
Fixed
- None
Deprecated
Datepoint::getSecondis deprecated in favor ofDatepoint::secondDatepoint::getMinuteis deprecated in favor ofDatepoint::minuteDatepoint::getHouris deprecated in favor ofDatepoint::hourDatepoint::getIsoWeekis deprecated in favor ofDatepoint::isoWeekDatepoint::getMonthis deprecated in favor ofDatepoint::monthDatepoint::getQuarteris deprecated in favor ofDatepoint::quarterDatepoint::getSemesteris deprecated in favor ofDatepoint::semesterDatepoint::getYearis deprecated in favor ofDatepoint::yearDatepoint::getIsoYearis deprecated in favor ofDatepoint::isoYearDuration::createfromDateIntervalis deprecated in favor ofDatepoint::fromDateIntervalDuration::createfromSecondsis deprecated in favor ofDatepoint::fromSecondsDuration::createfromChronoStringis deprecated in favor ofDatepoint::fromChronoStringDuration::createfromTimeStringis deprecated in favor ofDatepoint::fromTimeStringDuration::createfromDateStringis deprecated in favor ofDatepoint::fromDateStringPeriod::getTimestampIntervalis deprecated in favor ofPeriod::timeDurationPeriod::getDateIntervalis deprecated in favor ofPeriod::dateIntervalPeriod::getDatePeriodis deprecated in favor ofPeriod::dateRangeForwardPeriod::getDatePeriodBackwardsis deprecated in favor ofPeriod::dateRangeBackwardsPeriod::formatis deprecated in favor ofPeriod::toIso80000Period::splitis deprecated in favor ofPeriod::splitForwardPeriod::withBoundaryTypeis deprecated in favor ofPeriod::boundedByPeriod::timestampIntervalDiffis deprecated in favor ofPeriod::timeDurationDiffSequence::boundariesis deprecated in favor ofSequence::lengthSequence::getTotalTimestampIntervalis deprecated in favor ofSequence::totalTimeDuration
Removed
- None
version 4.11.0
Added
Period::fromDatepointDuration::createFromDateIntervalDuration::createFromTimeStringDuration::createFromChronoStringDuration::createFromSecondsDuration::createsupports DateInterval spec strings.- Support for PHP8
Fixed
Duration::createwhen using a float will now overflow the results up to the Hour unit.
Deprecated
- None
Removed
- None