Skip to content

version 5.0.0

Compare
Choose a tag to compare
@nyamsprod nyamsprod released this 22 Feb 17:09
· 70 commits to master since this release

Added

  • IntervalError used as the error interface marker.
  • InvalidInterval exception for anything regarding creating an object.
  • Duration::fromSeconds uses a dedicated fraction parameter and the seconds are no longer expressed using a float value.
  • Period::fromTimestamp to instantiate a time range object from two timestamps.
  • Period::fromIso80000 to instantiate a time range object from a mathematical representation and a date format.
  • Period::fromBourbaki to instantiate a time range object from a mathematical representation and a date format.
  • Period duration comparison methods accepts also Duration and DateInterval in addition to Period objects.
  • Period::union
  • Period::snapTo* methods to ease period expansion.
  • Period::meets
  • Period::meetsOnStart
  • Period::meetsOnEnd
  • Period::toBourbaki
  • Period::toIso80000
  • Period::toBourbaki
  • Bounds Enumeration.
  • InitialDatePresence Enumeration.
  • Sequence::toList
  • Chart\LetterCase Enumeration.
  • Chart\Alignment Enumeration.
  • Chart\StreamOutput class to replace Chart\ConsoleOutput class.
  • Chart\Terminal Enumeration.
  • Chart\ChartError used as the chart error interface marker.
  • Chart\UnableToDrawChart exception for anything regarding drawing a chart out of Period and/or Sequence objects.

Fixed

  • Switch from using Closure object instead of the callable pseudo type with the Sequence methods.
  • Period::diff returns a Sequence instance instead of an array.
  • Period::__construct is private.
  • Period named constructors, all parameters are required except for the boundaries.
  • Period::timeDuration now returns an int instead of a float value.
  • Period::intersect now can take multiple Period instances as parameters.
  • Period::subtract now can take multiple Period instances as parameters.
  • Duration no longer extends a DateInterval object.
  • Duration::fromIsoString supports 3 versions of dealing with fractions with ISO valid string.
  • Datepoint class renamed DatePoint.
  • DatePoint no longer extends a DateTimeImmutable object.
  • Argument names are normalized throughout the package. (PHP8 BC break)
  • Chart\LatinLetter in case of wrong value will fall back to A instead of 0 which is not a letter.
  • Chart\LatinLetter the starting label must be explicit on instantiation.
  • Chart\RomanNumber requires its two arguments to be explicitly set.

Deprecated

  • None

Removed

  • Support for PHP7 and PHP8.0
  • Period::fromDatepoint replaced by Period::fromDate
  • Period::getStartDate replaced by accessing readonly property Period::startDate
  • Period::getEndDate replaced by accessing readonly property Period::endDate
  • Period::getBoundaryType replaced by accessing readonly property Period::bounds
  • Period::getDateInterval replaced by Period::dateInterval
  • Period::getTimestampInterval replaced by Period::timeDuration
  • Period::withBoundaryType replaced by Period::boundedBy
  • Period::isStartIncluded with no replacement use Bounds::isStartIncluded
  • Period::isStartExcluded with no replacement use Bounds::isStartIncluded instead
  • Period::isEndIncluded with no replacement use Bounds::isEndIncluded
  • Period::isEndExcluded with no replacement use Bounds::isEndIncluded instead
  • Period::fromDatePeriod replaced by Period::fromDateRange
  • Period::getDatePeriod replaced by Period::dateRange
  • Period::getDatePeriodBackwards replaced by Period::dateRangeBackwards
  • Period::__string replaced by Period::toIso8601
  • Period::format replaced by Period::toIso80000
  • Period::split replaced by Period::splitForward
  • Period::substract use Period::subtract instead
  • Sequence::substract use Sequence::subtract instead
  • Sequence::getIntersections use Sequence::intersections instead
  • Sequence::getGaps use Sequence::gaps instead
  • Sequence::getBoundaries use Sequence::length instead
  • Sequence::getTotalTimestampInterval use Sequence::totalTimeDuration instead
  • Sequence::toArray use Sequence::toList instead
  • Duration::__toString and Duration::format with no replacement
  • Duration::create is removed with no replacement
  • Datepoint::create is removed with no replacement
  • The create prefix is removed from the Duration and Datepoint named 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\ConsoleOutput replaced by Chart\StreamOutput class.
  • Chart\RomanNumber::isLower use Chart\LetterCase::isUpper instead.
  • Chart\RomanNumber::startingAt use Chart\DecimalNumber::startLabel public readonly property
  • Chart\RomanNumber::startsWith is removed with no replacement
  • Chart\RomanNumber::withLetterCase is removed with no replacement
  • Chart\DecimalNumber::startsWith is removed with no replacement
  • Chart\LatinNumber::startsWith is removed with no replacement
  • Chart\LatinNumber::startingAt use Chart\LatinNumber::startLabel public readonly property
  • Chart\AffixLabel::withPrefix is removed with no replacement
  • Chart\AffixLabel::withSuffix is removed with no replacement
  • Chart\AffixLabel::prefix method use Chart\AffixLabel::labelPrefix public readonly property
  • Chart\AffixLabel::suffix method use Chart\AffixLabel::labelSuffix public readonly property

Removed all the following namespaced functions from the package:

  • League\Period\datepoint
  • League\Period\duration
  • League\Period\year
  • League\Period\semester
  • League\Period\quarter
  • League\Period\month
  • League\Period\day
  • League\Period\hour
  • League\Period\minute
  • League\Period\second
  • League\Period\instant
  • League\Period\iso_year
  • League\Period\iso_week
  • League\Period\interval_after
  • League\Period\interval_before
  • League\Period\interval_around
  • League\Period\interval_from_dateperiod