diff --git a/src/Clock.php b/src/Clock.php index df1f11e..bf8ccb4 100644 --- a/src/Clock.php +++ b/src/Clock.php @@ -8,8 +8,6 @@ interface Clock { /** * Returns the current time. - * - * @return Instant */ public function getTime() : Instant; } diff --git a/src/Clock/FixedClock.php b/src/Clock/FixedClock.php index 79df0f9..a02c4de 100644 --- a/src/Clock/FixedClock.php +++ b/src/Clock/FixedClock.php @@ -19,8 +19,6 @@ final class FixedClock implements Clock private $instant; /** - * Class constructor. - * * @param Instant $instant The time to set the clock at. */ public function __construct(Instant $instant) @@ -28,19 +26,11 @@ public function __construct(Instant $instant) $this->instant = $instant; } - /** - * {@inheritdoc} - */ public function getTime() : Instant { return $this->instant; } - /** - * @param Instant $instant - * - * @return void - */ public function setTime(Instant $instant) : void { $this->instant = $instant; @@ -48,11 +38,6 @@ public function setTime(Instant $instant) : void /** * Moves the clock by a number of seconds and/or nanos. - * - * @param int $seconds - * @param int $nanos - * - * @return void */ public function move(int $seconds, int $nanos = 0) : void { diff --git a/src/Clock/OffsetClock.php b/src/Clock/OffsetClock.php index 82018b3..e74a6e3 100644 --- a/src/Clock/OffsetClock.php +++ b/src/Clock/OffsetClock.php @@ -28,8 +28,6 @@ final class OffsetClock implements Clock private $offset; /** - * Class constructor. - * * @param Clock $referenceClock The reference clock. * @param Duration $offset The offset to apply to the clock. */ @@ -39,9 +37,6 @@ public function __construct(Clock $referenceClock, Duration $offset) $this->offset = $offset; } - /** - * {@inheritdoc} - */ public function getTime() : Instant { return $this->referenceClock->getTime()->plus($this->offset); diff --git a/src/Clock/ScaleClock.php b/src/Clock/ScaleClock.php index 90c9c17..a47cd56 100644 --- a/src/Clock/ScaleClock.php +++ b/src/Clock/ScaleClock.php @@ -35,8 +35,6 @@ final class ScaleClock implements Clock private $timeScale; /** - * Class constructor. - * * - a scale > 1 makes the time move at an accelerated pace; * - a scale == 1 makes the time move at the normal pace; * - a scale == 0 freezes the current time; @@ -52,9 +50,6 @@ public function __construct(Clock $referenceClock, int $timeScale) $this->timeScale = $timeScale; } - /** - * {@inheritdoc} - */ public function getTime() : Instant { $duration = Duration::between($this->startTime, $this->referenceClock->getTime()); diff --git a/src/Clock/SystemClock.php b/src/Clock/SystemClock.php index cecc9b2..2f769bf 100644 --- a/src/Clock/SystemClock.php +++ b/src/Clock/SystemClock.php @@ -14,9 +14,6 @@ */ final class SystemClock implements Clock { - /** - * {@inheritdoc} - */ public function getTime() : Instant { [$fraction, $epochSecond] = \explode(' ', microtime()); diff --git a/src/DateTimeException.php b/src/DateTimeException.php index a49cc01..82e1f7c 100644 --- a/src/DateTimeException.php +++ b/src/DateTimeException.php @@ -14,19 +14,12 @@ class DateTimeException extends \RuntimeException * @param int $value The actual value. * @param int $min The minimum allowed value. * @param int $max The maximum allowed value. - * - * @return DateTimeException */ public static function fieldNotInRange(string $field, int $value, int $min, int $max) : self { return new DateTimeException("Invalid $field: $value is not in the range $min to $max."); } - /** - * @param string $region - * - * @return DateTimeException - */ public static function unknownTimeZoneRegion(string $region) : self { return new self(\sprintf('Unknown time zone region "%s".', $region)); diff --git a/src/DayOfWeek.php b/src/DayOfWeek.php index d942661..d0309fb 100644 --- a/src/DayOfWeek.php +++ b/src/DayOfWeek.php @@ -40,8 +40,6 @@ private function __construct(int $value) * Returns a cached DayOfWeek instance. * * @param int $value The day-of-week value, validated from 1 to 7. - * - * @return DayOfWeek */ private static function get(int $value) : DayOfWeek { @@ -75,11 +73,6 @@ public static function of(int $dayOfWeek) : DayOfWeek * Returns the current day-of-week in the given time-zone, according to the given clock. * * If no clock is provided, the system clock is used. - * - * @param TimeZone $timeZone - * @param Clock|null $clock - * - * @return DayOfWeek */ public static function now(TimeZone $timeZone, ?Clock $clock = null) : DayOfWeek { @@ -110,70 +103,56 @@ public static function all(?DayOfWeek $first = null) : array /** * Returns a day-of-week instance for Monday. - * - * @return DayOfWeek */ - public static function monday() + public static function monday() : DayOfWeek { return DayOfWeek::get(DayOfWeek::MONDAY); } /** * Returns a day-of-week instance for Tuesday. - * - * @return DayOfWeek */ - public static function tuesday() + public static function tuesday() : DayOfWeek { return DayOfWeek::get(DayOfWeek::TUESDAY); } /** * Returns a day-of-week instance for Wednesday. - * - * @return DayOfWeek */ - public static function wednesday() + public static function wednesday() : DayOfWeek { return DayOfWeek::get(DayOfWeek::WEDNESDAY); } /** * Returns a day-of-week instance for Thursday. - * - * @return DayOfWeek */ - public static function thursday() + public static function thursday() : DayOfWeek { return DayOfWeek::get(DayOfWeek::THURSDAY); } /** * Returns a day-of-week instance for Friday. - * - * @return DayOfWeek */ - public static function friday() + public static function friday() : DayOfWeek { return DayOfWeek::get(DayOfWeek::FRIDAY); } /** * Returns a day-of-week instance for Saturday. - * - * @return DayOfWeek */ - public static function saturday() + public static function saturday() : DayOfWeek { return DayOfWeek::get(DayOfWeek::SATURDAY); } /** * Returns a day-of-week instance for Sunday. - * - * @return DayOfWeek */ - public static function sunday() + public static function sunday() : DayOfWeek { return DayOfWeek::get(DayOfWeek::SUNDAY); } @@ -206,10 +185,6 @@ public function is(int $dayOfWeek) : bool * Even though of() returns the same instance if the same day is requested several times, * do *not* use strict object comparison to compare two DayOfWeek instances, * as it is possible to get a different instance for the same day using serialization. - * - * @param DayOfWeek $that - * - * @return bool */ public function isEqualTo(DayOfWeek $that) : bool { @@ -218,10 +193,6 @@ public function isEqualTo(DayOfWeek $that) : bool /** * Returns the DayOfWeek that is the specified number of days after this one. - * - * @param int $days - * - * @return DayOfWeek */ public function plus(int $days) : DayOfWeek { @@ -230,10 +201,6 @@ public function plus(int $days) : DayOfWeek /** * Returns the DayOfWeek that is the specified number of days before this one. - * - * @param int $days - * - * @return DayOfWeek */ public function minus(int $days) : DayOfWeek { @@ -242,8 +209,6 @@ public function minus(int $days) : DayOfWeek /** * Serializes as a string using {@see DayOfWeek::__toString()}. - * - * @return string */ public function jsonSerialize() : string { @@ -252,10 +217,8 @@ public function jsonSerialize() : string /** * Returns the capitalized English name of this day-of-week. - * - * @return string */ - public function __toString() + public function __toString() : string { return [ 1 => 'Monday', diff --git a/src/DefaultClock.php b/src/DefaultClock.php index a970465..ff4f23b 100644 --- a/src/DefaultClock.php +++ b/src/DefaultClock.php @@ -30,8 +30,6 @@ private function __construct() /** * Gets the default clock. - * - * @return Clock */ public static function get() : Clock { @@ -44,10 +42,6 @@ public static function get() : Clock /** * Sets the default clock. - * - * @param Clock $clock - * - * @return void */ public static function set(Clock $clock) : void { @@ -56,8 +50,6 @@ public static function set(Clock $clock) : void /** * Resets the default clock to the system clock. - * - * @return void */ public static function reset() : void { @@ -68,8 +60,6 @@ public static function reset() : void * Freezes time to a specific point in time. * * @param Instant $instant The time to freeze to. - * - * @return void */ public static function freeze(Instant $instant) : void { @@ -80,10 +70,6 @@ public static function freeze(Instant $instant) : void * Travels to a specific point in time, but allows time to continue moving forward from there. * * If the current default clock is frozen, you must `reset()` it first, or the time will stay frozen. - * - * @param Instant $instant - * - * @return void */ public static function travel(Instant $instant) : void { @@ -103,10 +89,6 @@ public static function travel(Instant $instant) : void * * If the current default clock is frozen, you must `reset()` it first, or the time will stay frozen. * Multiple calls to `scale()` will result in a clock with the combined scales. - * - * @param int $timeScale The time scale. - * - * @return void */ public static function scale(int $timeScale) : void { diff --git a/src/Duration.php b/src/Duration.php index 108e96e..64db747 100644 --- a/src/Duration.php +++ b/src/Duration.php @@ -45,8 +45,6 @@ private function __construct(int $seconds, int $nanos = 0) /** * Returns a zero length Duration. - * - * @return \Brick\DateTime\Duration */ public static function zero() : Duration { @@ -69,11 +67,7 @@ public static function zero() : Duration * Each of the (days, hours, minutes, seconds) values can optionally be preceded with a '+' or '-' sign. * The whole string can also start with an optional '+' or '-' sign, which will further affect all the fields. * - * @param string $text - * - * @return \Brick\DateTime\Duration - * - * @throws \Brick\DateTime\Parser\DateTimeParseException + * @throws Parser\DateTimeParseException */ public static function parse(string $text) : Duration { @@ -151,8 +145,6 @@ public static function parse(string $text) : Duration * * @param int $seconds The number of seconds of the duration. * @param int $nanoAdjustment The adjustment to the duration in nanoseconds. - * - * @return \Brick\DateTime\Duration */ public static function ofSeconds(int $seconds, int $nanoAdjustment = 0) : Duration { @@ -170,10 +162,6 @@ public static function ofSeconds(int $seconds, int $nanoAdjustment = 0) : Durati /** * Returns a Duration from a number of milliseconds. - * - * @param int $millis - * - * @return Duration */ public static function ofMillis(int $millis) : Duration { @@ -185,10 +173,6 @@ public static function ofMillis(int $millis) : Duration /** * Returns a Duration from a number of nanoseconds. - * - * @param int $nanos - * - * @return Duration */ public static function ofNanos(int $nanos) : Duration { @@ -197,10 +181,6 @@ public static function ofNanos(int $nanos) : Duration /** * Returns a Duration from a number of minutes. - * - * @param int $minutes - * - * @return \Brick\DateTime\Duration */ public static function ofMinutes(int $minutes) : Duration { @@ -209,10 +189,6 @@ public static function ofMinutes(int $minutes) : Duration /** * Returns a Duration from a number of hours. - * - * @param int $hours - * - * @return \Brick\DateTime\Duration */ public static function ofHours(int $hours) : Duration { @@ -221,10 +197,6 @@ public static function ofHours(int $hours) : Duration /** * Returns a Duration from a number of days. - * - * @param int $days - * - * @return \Brick\DateTime\Duration */ public static function ofDays(int $days) : Duration { @@ -237,10 +209,8 @@ public static function ofDays(int $days) : Duration * A Duration represents a directed distance between two points on the time-line. * As such, this method will return a negative duration if the end is before the start. * - * @param \Brick\DateTime\Instant $startInclusive The start instant, inclusive. - * @param \Brick\DateTime\Instant $endExclusive The end instant, exclusive. - * - * @return \Brick\DateTime\Duration + * @param Instant $startInclusive The start instant, inclusive. + * @param Instant $endExclusive The end instant, exclusive. */ public static function between(Instant $startInclusive, Instant $endExclusive) : Duration { @@ -252,8 +222,6 @@ public static function between(Instant $startInclusive, Instant $endExclusive) : /** * Returns whether this Duration is zero length. - * - * @return bool */ public function isZero() : bool { @@ -262,8 +230,6 @@ public function isZero() : bool /** * Returns whether this Duration is positive, excluding zero. - * - * @return bool */ public function isPositive() : bool { @@ -272,8 +238,6 @@ public function isPositive() : bool /** * Returns whether this Duration is positive or zero. - * - * @return bool */ public function isPositiveOrZero() : bool { @@ -282,8 +246,6 @@ public function isPositiveOrZero() : bool /** * Returns whether this Duration is negative, excluding zero. - * - * @return bool */ public function isNegative() : bool { @@ -292,8 +254,6 @@ public function isNegative() : bool /** * Returns whether this Duration is negative or zero. - * - * @return bool */ public function isNegativeOrZero() : bool { @@ -302,10 +262,6 @@ public function isNegativeOrZero() : bool /** * Returns a copy of this Duration with the specified duration added. - * - * @param \Brick\DateTime\Duration $duration - * - * @return \Brick\DateTime\Duration */ public function plus(Duration $duration) : Duration { @@ -326,10 +282,6 @@ public function plus(Duration $duration) : Duration /** * Returns a copy of this Duration with the specified duration in seconds added. - * - * @param int $seconds - * - * @return \Brick\DateTime\Duration */ public function plusSeconds(int $seconds) : Duration { @@ -342,10 +294,6 @@ public function plusSeconds(int $seconds) : Duration /** * Returns a copy of this Duration with the specified duration in minutes added. - * - * @param int $minutes - * - * @return \Brick\DateTime\Duration */ public function plusMinutes(int $minutes) : Duration { @@ -354,10 +302,6 @@ public function plusMinutes(int $minutes) : Duration /** * Returns a copy of this Duration with the specified duration in hours added. - * - * @param int $hours - * - * @return \Brick\DateTime\Duration */ public function plusHours(int $hours) : Duration { @@ -366,10 +310,6 @@ public function plusHours(int $hours) : Duration /** * Returns a copy of this Duration with the specified duration in days added. - * - * @param int $days - * - * @return \Brick\DateTime\Duration */ public function plusDays(int $days) : Duration { @@ -378,10 +318,6 @@ public function plusDays(int $days) : Duration /** * Returns a copy of this Duration with the specified duration added. - * - * @param \Brick\DateTime\Duration $duration - * - * @return \Brick\DateTime\Duration */ public function minus(Duration $duration) : Duration { @@ -394,10 +330,6 @@ public function minus(Duration $duration) : Duration /** * Returns a copy of this Duration with the specified duration in seconds subtracted. - * - * @param int $seconds - * - * @return \Brick\DateTime\Duration */ public function minusSeconds(int $seconds) : Duration { @@ -406,10 +338,6 @@ public function minusSeconds(int $seconds) : Duration /** * Returns a copy of this Duration with the specified duration in minutes subtracted. - * - * @param int $minutes - * - * @return \Brick\DateTime\Duration */ public function minusMinutes(int $minutes) : Duration { @@ -418,10 +346,6 @@ public function minusMinutes(int $minutes) : Duration /** * Returns a copy of this Duration with the specified duration in hours subtracted. - * - * @param int $hours - * - * @return \Brick\DateTime\Duration */ public function minusHours(int $hours) : Duration { @@ -430,10 +354,6 @@ public function minusHours(int $hours) : Duration /** * Returns a copy of this Duration with the specified duration in days subtracted. - * - * @param int $days - * - * @return \Brick\DateTime\Duration */ public function minusDays(int $days) : Duration { @@ -442,10 +362,6 @@ public function minusDays(int $days) : Duration /** * Returns a copy of this Duration multiplied by the given value. - * - * @param int $multiplicand - * - * @return \Brick\DateTime\Duration */ public function multipliedBy(int $multiplicand) : Duration { @@ -464,10 +380,6 @@ public function multipliedBy(int $multiplicand) : Duration * * If this yields an inexact result, the result will be rounded down. * - * @param int $divisor - * - * @return \Brick\DateTime\Duration - * * @throws DateTimeException If the divisor is zero. */ public function dividedBy(int $divisor) : Duration @@ -508,8 +420,6 @@ public function dividedBy(int $divisor) : Duration /** * Returns a copy of this Duration with the length negated. - * - * @return \Brick\DateTime\Duration */ public function negated() : Duration { @@ -530,8 +440,6 @@ public function negated() : Duration /** * Returns a copy of this Duration with a positive length. - * - * @return \Brick\DateTime\Duration */ public function abs() : Duration { @@ -541,7 +449,7 @@ public function abs() : Duration /** * Compares this Duration to the specified duration. * - * @param \Brick\DateTime\Duration $that The other duration to compare to. + * @param Duration $that The other duration to compare to. * * @return int [-1,0,1] If this duration is less than, equal to, or greater than the given duration. */ @@ -564,10 +472,6 @@ public function compareTo(Duration $that) : int /** * Checks if this Duration is equal to the specified duration. - * - * @param \Brick\DateTime\Duration $that - * - * @return bool */ public function isEqualTo(Duration $that) : bool { @@ -576,10 +480,6 @@ public function isEqualTo(Duration $that) : bool /** * Checks if this Duration is greater than the specified duration. - * - * @param \Brick\DateTime\Duration $that - * - * @return bool */ public function isGreaterThan(Duration $that) : bool { @@ -588,10 +488,6 @@ public function isGreaterThan(Duration $that) : bool /** * Checks if this Duration is less than the specified duration. - * - * @param \Brick\DateTime\Duration $that - * - * @return bool */ public function isLessThan(Duration $that) : bool { @@ -600,8 +496,6 @@ public function isLessThan(Duration $that) : bool /** * Returns the total length in seconds of this Duration. - * - * @return int */ public function getSeconds() : int { @@ -610,8 +504,6 @@ public function getSeconds() : int /** * Returns the nanoseconds adjustment of this Duration, in the range 0 to 999,999,999. - * - * @return int */ public function getNanos() : int { @@ -624,8 +516,6 @@ public function getNanos() : int * The result is rounded towards negative infinity. * * @todo deprecate in favour of toMillis() - caution: rounding is different - * - * @return int */ public function getTotalMillis() : int { @@ -639,8 +529,6 @@ public function getTotalMillis() : int * Returns the total number of microseconds in this Duration. * * The result is rounded towards negative infinity. - * - * @return int */ public function getTotalMicros() : int { @@ -650,9 +538,6 @@ public function getTotalMicros() : int return $micros; } - /** - * @return int - */ public function getTotalNanos() : int { $nanos = $this->seconds * 1000000000; @@ -668,8 +553,6 @@ public function getTotalNanos() : int * This is based on the standard definition of a day as 24 hours. * * This instance is immutable and unaffected by this method call. - * - * @return int */ public function toDays() : int { @@ -682,8 +565,6 @@ public function toDays() : int * This return the same value as `toDays()`, and is provided solely for consistency. * * This instance is immutable and unaffected by this method call. - * - * @return int */ public function toDaysPart() : int { @@ -696,8 +577,6 @@ public function toDaysPart() : int * This returns the total number of hours in the duration by dividing the number of seconds by 3600. * * This instance is immutable and unaffected by this method call. - * - * @return int */ public function toHours() : int { @@ -711,8 +590,6 @@ public function toHours() : int * This is based on the standard definition of a day as 24 hours. * * This instance is immutable and unaffected by this method call. - * - * @return int */ public function toHoursPart() : int { @@ -725,8 +602,6 @@ public function toHoursPart() : int * This returns the total number of minutes in the duration by dividing the number of seconds by 60. * * This instance is immutable and unaffected by this method call. - * - * @return int */ public function toMinutes() : int { @@ -740,8 +615,6 @@ public function toMinutes() : int * This is based on the standard definition of an hour as 60 minutes. * * This instance is immutable and unaffected by this method call. - * - * @return int */ public function toMinutesPart() : int { @@ -754,8 +627,6 @@ public function toMinutesPart() : int * This returns the total number of whole seconds in the duration. * * This instance is immutable and unaffected by this method call. - * - * @return int */ public function toSeconds() : int { @@ -769,8 +640,6 @@ public function toSeconds() : int * This is based on the standard definition of a minute as 60 seconds. * * This instance is immutable and unaffected by this method call. - * - * @return int */ public function toSecondsPart() : int { @@ -785,8 +654,6 @@ public function toSecondsPart() : int * If this duration has greater than millisecond precision, then the conversion will drop any excess precision * information as though the amount in nanoseconds was subject to integer division by one million. * - * @return int - * * @throws ArithmeticError */ public function toMillis() : int @@ -814,8 +681,6 @@ public function toMillis() : int * The total duration is defined by calling `getNanos()` and `getSeconds()`. * * This instance is immutable and unaffected by this method call. - * - * @return int */ public function toMillisPart() : int { @@ -827,8 +692,6 @@ public function toMillisPart() : int * * If this duration is too large to fit in an integer, then an exception is thrown. * - * @return int - * * @throws ArithmeticError */ public function toNanos() : int @@ -855,8 +718,6 @@ public function toNanos() : int * The total duration is defined by calling `getNanos()` and `getSeconds()`. * * This instance is immutable and unaffected by this method call. - * - * @return int */ public function toNanosPart() : int { @@ -865,8 +726,6 @@ public function toNanosPart() : int /** * Serializes as a string using {@see Duration::__toString()}. - * - * @return string */ public function jsonSerialize() : string { @@ -883,8 +742,6 @@ public function jsonSerialize() : string * The hours, minutes and seconds will all have the same sign. * * Note that multiples of 24 hours are not output as days to avoid confusion with Period. - * - * @return string */ public function __toString() : string { diff --git a/src/Field/DayOfMonth.php b/src/Field/DayOfMonth.php index 1e2e5e9..fee51fe 100644 --- a/src/Field/DayOfMonth.php +++ b/src/Field/DayOfMonth.php @@ -26,8 +26,6 @@ final class DayOfMonth * @param int|null $monthOfYear An optional month-of-year to check against, validated. * @param int|null $year An optional year to check against, validated. * - * @return void - * * @throws DateTimeException If the day-of-month is not valid. */ public static function check(int $dayOfMonth, ?int $monthOfYear = null, ?int $year = null) : void diff --git a/src/Field/DayOfWeek.php b/src/Field/DayOfWeek.php index bf06873..7aae3a6 100644 --- a/src/Field/DayOfWeek.php +++ b/src/Field/DayOfWeek.php @@ -19,8 +19,6 @@ final class DayOfWeek /** * @param int $dayOfWeek The day-of-week to check. * - * @return void - * * @throws DateTimeException If the day-of-week is not valid. */ public static function check(int $dayOfWeek) : void diff --git a/src/Field/DayOfYear.php b/src/Field/DayOfYear.php index f84034a..ea0804b 100644 --- a/src/Field/DayOfYear.php +++ b/src/Field/DayOfYear.php @@ -20,8 +20,6 @@ final class DayOfYear * @param int $dayOfYear The day-of-year to check. * @param int|null $year An optional year to check against, validated. * - * @return void - * * @throws DateTimeException If the day-of-year is not valid. */ public static function check(int $dayOfYear, ?int $year = null) : void diff --git a/src/Field/HourOfDay.php b/src/Field/HourOfDay.php index 1202bb4..ab5e21a 100644 --- a/src/Field/HourOfDay.php +++ b/src/Field/HourOfDay.php @@ -24,8 +24,6 @@ final class HourOfDay /** * @param int $hourOfDay The hour-of-day to check. * - * @return void - * * @throws DateTimeException If the hour-of-day is not valid. */ public static function check(int $hourOfDay) : void diff --git a/src/Field/MinuteOfHour.php b/src/Field/MinuteOfHour.php index ecef935..06d60e7 100644 --- a/src/Field/MinuteOfHour.php +++ b/src/Field/MinuteOfHour.php @@ -24,8 +24,6 @@ final class MinuteOfHour /** * @param int $minuteOfHour The minute-of-hour to check. * - * @return void - * * @throws DateTimeException If the minute-of-hour is not valid. */ public static function check(int $minuteOfHour) : void diff --git a/src/Field/MonthOfYear.php b/src/Field/MonthOfYear.php index 9e11547..b405e4d 100644 --- a/src/Field/MonthOfYear.php +++ b/src/Field/MonthOfYear.php @@ -24,8 +24,6 @@ final class MonthOfYear /** * @param int $monthOfYear The month-of-year to check. * - * @return void - * * @throws DateTimeException If the month-of-year is not valid. */ public static function check(int $monthOfYear) : void @@ -42,8 +40,6 @@ public static function check(int $monthOfYear) : void * * @param int $monthOfYear The month-of-year, validated. * @param int|null $year An optional year the month-of-year belongs to, validated. - * - * @return int */ public static function getLength(int $monthOfYear, ?int $year = null) : int { @@ -66,8 +62,6 @@ public static function getLength(int $monthOfYear, ?int $year = null) : int * Returns the camel-cased English name of the given month-of-year. * * @param int $monthOfYear The month-of-year, validated. - * - * @return string */ public static function getName(int $monthOfYear) : string { diff --git a/src/Field/NanoOfSecond.php b/src/Field/NanoOfSecond.php index fd3b631..3abcc14 100644 --- a/src/Field/NanoOfSecond.php +++ b/src/Field/NanoOfSecond.php @@ -19,8 +19,6 @@ final class NanoOfSecond /** * @param int $nanoOfSecond The nano-of-second to check. * - * @return void - * * @throws DateTimeException If the nano-of-second is not valid. */ public static function check(int $nanoOfSecond) : void diff --git a/src/Field/SecondOfDay.php b/src/Field/SecondOfDay.php index 40b3a3f..6c8b322 100644 --- a/src/Field/SecondOfDay.php +++ b/src/Field/SecondOfDay.php @@ -19,8 +19,6 @@ final class SecondOfDay /** * @param int $secondOfDay The second-of-day to check. * - * @return void - * * @throws DateTimeException If the second-of-day is not valid. */ public static function check(int $secondOfDay) : void diff --git a/src/Field/SecondOfMinute.php b/src/Field/SecondOfMinute.php index a08ec24..37ae968 100644 --- a/src/Field/SecondOfMinute.php +++ b/src/Field/SecondOfMinute.php @@ -24,8 +24,6 @@ final class SecondOfMinute /** * @param int $secondOfMinute The second-of-minute to check. * - * @return void - * * @throws DateTimeException If the second-of-minute is not valid. */ public static function check(int $secondOfMinute) : void diff --git a/src/Field/TimeZoneOffsetHour.php b/src/Field/TimeZoneOffsetHour.php index f620ce8..f84e29b 100644 --- a/src/Field/TimeZoneOffsetHour.php +++ b/src/Field/TimeZoneOffsetHour.php @@ -24,8 +24,6 @@ final class TimeZoneOffsetHour /** * @param int $offsetHour The offset-hour to check. * - * @return void - * * @throws DateTimeException If the offset-hour is not valid. */ public static function check(int $offsetHour) : void diff --git a/src/Field/TimeZoneOffsetMinute.php b/src/Field/TimeZoneOffsetMinute.php index 6794afc..a3b8a39 100644 --- a/src/Field/TimeZoneOffsetMinute.php +++ b/src/Field/TimeZoneOffsetMinute.php @@ -24,8 +24,6 @@ final class TimeZoneOffsetMinute /** * @param int $offsetMinute The offset-minute to check. * - * @return void - * * @throws DateTimeException If the offset-minute is not valid. */ public static function check(int $offsetMinute) : void diff --git a/src/Field/TimeZoneOffsetSecond.php b/src/Field/TimeZoneOffsetSecond.php index 1ece32c..265a9b6 100644 --- a/src/Field/TimeZoneOffsetSecond.php +++ b/src/Field/TimeZoneOffsetSecond.php @@ -24,8 +24,6 @@ final class TimeZoneOffsetSecond /** * @param int $offsetSecond The offset-second to check. * - * @return void - * * @throws DateTimeException If the offset-second is not valid. */ public static function check(int $offsetSecond) : void diff --git a/src/Field/TimeZoneOffsetTotalSeconds.php b/src/Field/TimeZoneOffsetTotalSeconds.php index d57f166..8deef39 100644 --- a/src/Field/TimeZoneOffsetTotalSeconds.php +++ b/src/Field/TimeZoneOffsetTotalSeconds.php @@ -26,8 +26,6 @@ final class TimeZoneOffsetTotalSeconds /** * @param int $offsetSeconds The offset-seconds to check. * - * @return void - * * @throws DateTimeException If the offset-seconds is not valid. */ public static function check(int $offsetSeconds) : void diff --git a/src/Field/WeekOfYear.php b/src/Field/WeekOfYear.php index 2e61901..195f9fa 100644 --- a/src/Field/WeekOfYear.php +++ b/src/Field/WeekOfYear.php @@ -20,9 +20,7 @@ final class WeekOfYear /** * @param int $weekOfYear The week-of-year to check. - * @parma int|null $year An optional year to check against, validated. - * - * @return void + * @param int|null $year An optional year to check against, validated. * * @throws DateTimeException If the week-of-year is not valid. */ diff --git a/src/Field/Year.php b/src/Field/Year.php index 19197f9..466997d 100644 --- a/src/Field/Year.php +++ b/src/Field/Year.php @@ -34,8 +34,6 @@ final class Year /** * @param int $year The year to check. * - * @return void - * * @throws DateTimeException If the year is not valid. */ public static function check(int $year) : void @@ -47,8 +45,6 @@ public static function check(int $year) : void /** * @param int $year The year, validated. - * - * @return bool */ public static function isLeap(int $year) : bool { diff --git a/src/Instant.php b/src/Instant.php index e955c51..2799cfb 100644 --- a/src/Instant.php +++ b/src/Instant.php @@ -55,8 +55,6 @@ private function __construct(int $epochSecond, int $nano) * * @param int $epochSecond The number of seconds since the UNIX epoch of 1970-01-01T00:00:00Z. * @param int $nanoAdjustment The adjustment to the epoch second in nanoseconds. - * - * @return Instant */ public static function of(int $epochSecond, int $nanoAdjustment = 0) : Instant { @@ -72,19 +70,11 @@ public static function of(int $epochSecond, int $nanoAdjustment = 0) : Instant return new Instant($epochSecond, $nanos); } - /** - * @return Instant - */ public static function epoch() : Instant { return new Instant(0, 0); } - /** - * @param Clock|null $clock - * - * @return Instant - */ public static function now(?Clock $clock = null) : Instant { if ($clock === null) { @@ -98,8 +88,6 @@ public static function now(?Clock $clock = null) : Instant * Returns the minimum supported instant. * * This could be used by an application as a "far past" instant. - * - * @return Instant */ public static function min() : Instant { @@ -110,19 +98,12 @@ public static function min() : Instant * Returns the maximum supported instant. * * This could be used by an application as a "far future" instant. - * - * @return Instant */ public static function max() : Instant { return new Instant(\PHP_INT_MAX, 999999999); } - /** - * @param Duration $duration - * - * @return Instant - */ public function plus(Duration $duration) : Instant { if ($duration->isZero()) { @@ -135,11 +116,6 @@ public function plus(Duration $duration) : Instant return Instant::of($seconds, $nanos); } - /** - * @param Duration $duration - * - * @return Instant - */ public function minus(Duration $duration) : Instant { if ($duration->isZero()) { @@ -149,11 +125,6 @@ public function minus(Duration $duration) : Instant return $this->plus($duration->negated()); } - /** - * @param int $seconds - * - * @return Instant - */ public function plusSeconds(int $seconds) : Instant { if ($seconds === 0) { @@ -163,72 +134,38 @@ public function plusSeconds(int $seconds) : Instant return new Instant($this->epochSecond + $seconds, $this->nano); } - /** - * @param int $seconds - * - * @return Instant - */ public function minusSeconds(int $seconds) : Instant { return $this->plusSeconds(-$seconds); } - /** - * @param int $minutes - * - * @return Instant - */ public function plusMinutes(int $minutes) : Instant { return $this->plusSeconds($minutes * LocalTime::SECONDS_PER_MINUTE); } - /** - * @param int $minutes - * - * @return Instant - */ public function minusMinutes(int $minutes) : Instant { return $this->plusMinutes(-$minutes); } - /** - * @param int $hours - * - * @return Instant - */ public function plusHours(int $hours) : Instant { return $this->plusSeconds($hours * LocalTime::SECONDS_PER_HOUR); } - /** - * @param int $hours - * - * @return Instant - */ public function minusHours(int $hours) : Instant { return $this->plusHours(-$hours); } - /** - * @param int $days - * - * @return Instant - */ public function plusDays(int $days) : Instant { return $this->plusSeconds($days * LocalTime::SECONDS_PER_DAY); } /** - * Returns a copy of this Instant with epoch second altered. - * - * @param int $epochSecond - * - * @return Instant + * Returns a copy of this Instant with the epoch second altered. */ public function withEpochSecond(int $epochSecond) : Instant { @@ -242,10 +179,6 @@ public function withEpochSecond(int $epochSecond) : Instant /** * Returns a copy of this Instant with the nano-of-second altered. * - * @param int $nano - * - * @return Instant - * * @throws DateTimeException If the nano-of-second if not valid. */ public function withNano(int $nano) : Instant @@ -259,27 +192,16 @@ public function withNano(int $nano) : Instant return new Instant($this->epochSecond, $nano); } - /** - * @param int $days - * - * @return Instant - */ public function minusDays(int $days) : Instant { return $this->plusDays(-$days); } - /** - * @return int - */ public function getEpochSecond() : int { return $this->epochSecond; } - /** - * @return int - */ public function getNano() : int { return $this->nano; @@ -288,8 +210,6 @@ public function getNano() : int /** * Compares this instant with another. * - * @param Instant $that - * * @return int [-1,0,1] If this instant is before, on, or after the given instant. */ public function compareTo(Instant $that) : int @@ -311,10 +231,6 @@ public function compareTo(Instant $that) : int /** * Returns whether this instant equals another. - * - * @param Instant $that - * - * @return bool */ public function isEqualTo(Instant $that) : bool { @@ -323,10 +239,6 @@ public function isEqualTo(Instant $that) : bool /** * Returns whether this instant is after another. - * - * @param Instant $that - * - * @return bool */ public function isAfter(Instant $that) : bool { @@ -335,10 +247,6 @@ public function isAfter(Instant $that) : bool /** * Returns whether this instant is after or equal to another. - * - * @param Instant $that - * - * @return bool */ public function isAfterOrEqualTo(Instant $that) : bool { @@ -347,10 +255,6 @@ public function isAfterOrEqualTo(Instant $that) : bool /** * Returns whether this instant is before another. - * - * @param Instant $that - * - * @return bool */ public function isBefore(Instant $that) : bool { @@ -359,33 +263,17 @@ public function isBefore(Instant $that) : bool /** * Returns whether this instant is before or equal to another. - * - * @param Instant $that - * - * @return bool */ public function isBeforeOrEqualTo(Instant $that) : bool { return $this->compareTo($that) <= 0; } - /** - * @param Instant $from - * @param Instant $to - * - * @return bool - */ public function isBetweenInclusive(Instant $from, Instant $to) : bool { return $this->isAfterOrEqualTo($from) && $this->isBeforeOrEqualTo($to); } - /** - * @param Instant $from - * @param Instant $to - * - * @return bool - */ public function isBetweenExclusive(Instant $from, Instant $to) : bool { return $this->isAfter($from) && $this->isBefore($to); @@ -395,10 +283,6 @@ public function isBetweenExclusive(Instant $from, Instant $to) : bool * Returns whether this instant is in the future, according to the given clock. * * If no clock is provided, the system clock is used. - * - * @param Clock|null $clock - * - * @return bool */ public function isFuture(?Clock $clock = null) : bool { @@ -409,10 +293,6 @@ public function isFuture(?Clock $clock = null) : bool * Returns whether this instant is in the past, according to the given clock. * * If no clock is provided, the system clock is used. - * - * @param Clock|null $clock - * - * @return bool */ public function isPast(?Clock $clock = null) : bool { @@ -421,10 +301,6 @@ public function isPast(?Clock $clock = null) : bool /** * Returns a ZonedDateTime formed from this instant and the specified time-zone. - * - * @param TimeZone $timeZone - * - * @return ZonedDateTime */ public function atTimeZone(TimeZone $timeZone) : ZonedDateTime { @@ -437,8 +313,6 @@ public function atTimeZone(TimeZone $timeZone) : ZonedDateTime * The output does not have trailing decimal zeros. * * Examples: `123456789`, `123456789.5`, `123456789.000000001`. - * - * @return string */ public function toDecimal() : string { @@ -457,17 +331,12 @@ public function toDecimal() : string /** * Serializes as a string using {@see Instant::__toString()}. - * - * @return string */ public function jsonSerialize() : string { return (string) $this; } - /** - * @return string - */ public function __toString() : string { return (string) ZonedDateTime::ofInstant($this, TimeZone::utc()); diff --git a/src/Interval.php b/src/Interval.php index f1f5c93..5b014c0 100644 --- a/src/Interval.php +++ b/src/Interval.php @@ -15,22 +15,20 @@ final class Interval implements \JsonSerializable /** * The start instant, inclusive. * - * @var \Brick\DateTime\Instant + * @var Instant */ private $start; /** * The end instant, exclusive. * - * @var \Brick\DateTime\Instant + * @var Instant */ private $end; /** - * Class constructor. - * - * @param \Brick\DateTime\Instant $startInclusive The start instant, inclusive. - * @param \Brick\DateTime\Instant $endExclusive The end instant, exclusive. + * @param Instant $startInclusive The start instant, inclusive. + * @param Instant $endExclusive The end instant, exclusive. * * @throws DateTimeException If the end instant is before the start instant. */ @@ -46,8 +44,6 @@ public function __construct(Instant $startInclusive, Instant $endExclusive) /** * Returns the start instant, inclusive, of this Interval. - * - * @return \Brick\DateTime\Instant */ public function getStart() : Instant { @@ -56,8 +52,6 @@ public function getStart() : Instant /** * Returns the end instant, exclusive, of this Interval. - * - * @return \Brick\DateTime\Instant */ public function getEnd() : Instant { @@ -67,10 +61,6 @@ public function getEnd() : Instant /** * Returns a copy of this Interval with the start instant altered. * - * @param \Brick\DateTime\Instant $start - * - * @return \Brick\DateTime\Interval - * * @throws DateTimeException If the given start instant is after the current end instant. */ public function withStart(Instant $start) : Interval @@ -81,10 +71,6 @@ public function withStart(Instant $start) : Interval /** * Returns a copy of this Interval with the end instant altered. * - * @param \Brick\DateTime\Instant $end - * - * @return \Brick\DateTime\Interval - * * @throws DateTimeException If the given end instant is before the current start instant. */ public function withEnd(Instant $end) : Interval @@ -94,8 +80,6 @@ public function withEnd(Instant $end) : Interval /** * Returns a Duration representing the time elapsed in this Interval. - * - * @return \Brick\DateTime\Duration */ public function getDuration() : Duration { @@ -104,17 +88,12 @@ public function getDuration() : Duration /** * Serializes as a string using {@see Interval::__toString()}. - * - * @return string */ public function jsonSerialize() : string { return (string) $this; } - /** - * @return string - */ public function __toString() : string { return $this->start . '/' . $this->end; diff --git a/src/LocalDate.php b/src/LocalDate.php index 964c421..d22f277 100644 --- a/src/LocalDate.php +++ b/src/LocalDate.php @@ -79,8 +79,6 @@ private function __construct(int $year, int $month, int $day) * @param int $month The month-of-year, from 1 (January) to 12 (December). * @param int $day The day-of-month, from 1 to 31. * - * @return LocalDate The LocalDate instance. - * * @throws DateTimeException If the date is not valid. */ public static function of(int $year, int $month, int $day) : LocalDate @@ -98,8 +96,6 @@ public static function of(int $year, int $month, int $day) : LocalDate * @param int $year The year, from MIN_YEAR to MAX_YEAR. * @param int $dayOfYear The day-of-year, from 1 to 366. * - * @return LocalDate - * * @throws DateTimeException If either value is not valid. */ public static function ofYearDay(int $year, int $dayOfYear) : LocalDate @@ -122,10 +118,6 @@ public static function ofYearDay(int $year, int $dayOfYear) : LocalDate } /** - * @param DateTimeParseResult $result - * - * @return LocalDate - * * @throws DateTimeException If the date is not valid. * @throws DateTimeParseException If required fields are missing from the result. */ @@ -144,8 +136,6 @@ public static function from(DateTimeParseResult $result) : LocalDate * @param string $text The text to parse, such as `2007-12-03`. * @param DateTimeParser|null $parser The parser to use, defaults to the ISO 8601 parser. * - * @return LocalDate - * * @throws DateTimeException If the date is not valid. * @throws DateTimeParseException If the text string does not follow the expected format. */ @@ -160,10 +150,6 @@ public static function parse(string $text, ?DateTimeParser $parser = null) : Loc /** * Creates a LocalDate from a native DateTime or DateTimeImmutable object. - * - * @param \DateTimeInterface $dateTime - * - * @return LocalDate */ public static function fromDateTime(\DateTimeInterface $dateTime) : LocalDate { @@ -180,10 +166,6 @@ public static function fromDateTime(\DateTimeInterface $dateTime) : LocalDate * The Epoch Day count is a simple incrementing count of days * where day 0 is 1970-01-01. Negative numbers represent earlier days. * - * @param int $epochDay - * - * @return LocalDate - * * @throws DateTimeException If the resulting date has a year out of range. */ public static function ofEpochDay(int $epochDay) : LocalDate @@ -224,11 +206,6 @@ public static function ofEpochDay(int $epochDay) : LocalDate * Returns the current date in the given time-zone, according to the given clock. * * If no clock is provided, the system clock is used. - * - * @param TimeZone $timeZone - * @param Clock|null $clock - * - * @return LocalDate */ public static function now(TimeZone $timeZone, ?Clock $clock = null) : LocalDate { @@ -239,8 +216,6 @@ public static function now(TimeZone $timeZone, ?Clock $clock = null) : LocalDate * Returns the minimum supported LocalDate. * * This can be used by an application as a "far past" date. - * - * @return LocalDate */ public static function min() : LocalDate { @@ -251,8 +226,6 @@ public static function min() : LocalDate * Returns the maximum supported LocalDate. * * This can be used by an application as a "far future" date. - * - * @return LocalDate */ public static function max() : LocalDate { @@ -311,41 +284,26 @@ public static function maxOf(LocalDate ...$dates) : LocalDate return $max; } - /** - * @return int - */ public function getYear() : int { return $this->year; } - /** - * @return int - */ public function getMonth() : int { return $this->month; } - /** - * @return int - */ public function getDay() : int { return $this->day; } - /** - * @return YearMonth - */ public function getYearMonth() : YearMonth { return YearMonth::of($this->year, $this->month); } - /** - * @return DayOfWeek - */ public function getDayOfWeek() : DayOfWeek { return DayOfWeek::of(Math::floorMod($this->toEpochDay() + 3, 7) + 1); @@ -353,17 +311,12 @@ public function getDayOfWeek() : DayOfWeek /** * Returns the day-of-year, from 1 to 365, or 366 in a leap year. - * - * @return int */ public function getDayOfYear() : int { return Month::of($this->month)->getFirstDayOfYear($this->isLeapYear()) + $this->day - 1; } - /** - * @return YearWeek - */ public function getYearWeek() : YearWeek { $year = $this->year; @@ -385,10 +338,6 @@ public function getYearWeek() : YearWeek * * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month. * - * @param int $year - * - * @return LocalDate - * * @throws DateTimeException If the year is outside the valid range. */ public function withYear(int $year) : LocalDate @@ -407,10 +356,6 @@ public function withYear(int $year) : LocalDate * * If the day-of-month is invalid for the month and year, it will be changed to the last valid day of the month. * - * @param int $month - * - * @return LocalDate - * * @throws DateTimeException If the month is invalid. */ public function withMonth(int $month) : LocalDate @@ -429,10 +374,6 @@ public function withMonth(int $month) : LocalDate * * If the resulting date is invalid, an exception is thrown. * - * @param int $day - * - * @return LocalDate - * * @throws DateTimeException If the day is invalid for the current year and month. */ public function withDay(int $day) : LocalDate @@ -448,10 +389,6 @@ public function withDay(int $day) : LocalDate /** * Returns a copy of this LocalDate with the specified Period added. - * - * @param Period $period - * - * @return LocalDate */ public function plusPeriod(Period $period) : LocalDate { @@ -467,10 +404,6 @@ public function plusPeriod(Period $period) : LocalDate * If the day-of-month is invalid for the resulting year and month, * it will be changed to the last valid day of the month. * - * @param int $years - * - * @return LocalDate - * * @throws DateTimeException If the resulting year is out of range. */ public function plusYears(int $years) : LocalDate @@ -487,10 +420,6 @@ public function plusYears(int $years) : LocalDate * * If the day-of-month is invalid for the resulting year and month, * it will be changed to the last valid day of the month. - * - * @param int $months - * - * @return LocalDate */ public function plusMonths(int $months) : LocalDate { @@ -506,10 +435,6 @@ public function plusMonths(int $months) : LocalDate /** * Returns a copy of this LocalDate with the specified period in weeks added. - * - * @param int $weeks - * - * @return LocalDate */ public function plusWeeks(int $weeks) : LocalDate { @@ -522,10 +447,6 @@ public function plusWeeks(int $weeks) : LocalDate /** * Returns a copy of this LocalDate with the specified period in days added. - * - * @param int $days - * - * @return LocalDate */ public function plusDays(int $days) : LocalDate { @@ -538,10 +459,6 @@ public function plusDays(int $days) : LocalDate /** * Returns a copy of this LocalDate with the specified Period subtracted. - * - * @param Period $period - * - * @return LocalDate */ public function minusPeriod(Period $period) : LocalDate { @@ -550,10 +467,6 @@ public function minusPeriod(Period $period) : LocalDate /** * Returns a copy of this LocalDate with the specified period in years subtracted. - * - * @param int $years - * - * @return LocalDate */ public function minusYears(int $years) : LocalDate { @@ -562,10 +475,6 @@ public function minusYears(int $years) : LocalDate /** * Returns a copy of this LocalDate with the specified period in months subtracted. - * - * @param int $months - * - * @return LocalDate */ public function minusMonths(int $months) : LocalDate { @@ -574,10 +483,6 @@ public function minusMonths(int $months) : LocalDate /** * Returns a copy of this LocalDate with the specified period in weeks subtracted. - * - * @param int $weeks - * - * @return LocalDate */ public function minusWeeks(int $weeks) : LocalDate { @@ -586,10 +491,6 @@ public function minusWeeks(int $weeks) : LocalDate /** * Returns a copy of this LocalDate with the specified period in days subtracted. - * - * @param int $days - * - * @return LocalDate */ public function minusDays(int $days) : LocalDate { @@ -599,8 +500,6 @@ public function minusDays(int $days) : LocalDate /** * Returns -1 if this date is before the given date, 1 if after, 0 if the dates are equal. * - * @param LocalDate $that - * * @return int [-1,0,1] If this date is before, on, or after the given date. */ public function compareTo(LocalDate $that) : int @@ -627,51 +526,26 @@ public function compareTo(LocalDate $that) : int return 0; } - /** - * @param LocalDate $that - * - * @return bool - */ public function isEqualTo(LocalDate $that) : bool { return $this->compareTo($that) === 0; } - /** - * @param LocalDate $that - * - * @return bool - */ public function isBefore(LocalDate $that) : bool { return $this->compareTo($that) === -1; } - /** - * @param LocalDate $that - * - * @return bool - */ public function isBeforeOrEqualTo(LocalDate $that) : bool { return $this->compareTo($that) <= 0; } - /** - * @param LocalDate $that - * - * @return bool - */ public function isAfter(LocalDate $that) : bool { return $this->compareTo($that) === 1; } - /** - * @param LocalDate $that - * - * @return bool - */ public function isAfterOrEqualTo(LocalDate $that) : bool { return $this->compareTo($that) >= 0; @@ -692,10 +566,6 @@ public function isAfterOrEqualTo(LocalDate $that) : bool * than or equal to the start day-of-month. * * For example, from `2010-01-15` to `2011-03-18` is 1 year, 2 months and 3 days. - * - * @param LocalDate $endDateExclusive - * - * @return Period */ public function until(LocalDate $endDateExclusive) : Period { @@ -722,10 +592,6 @@ public function until(LocalDate $endDateExclusive) : Period * * The start date is included, but the end date is not. * For example, `2018-02-15` to `2018-04-01` is 45 days. - * - * @param LocalDate $endDateExclusive - * - * @return int */ public function daysUntil(LocalDate $endDateExclusive) : int { @@ -734,10 +600,6 @@ public function daysUntil(LocalDate $endDateExclusive) : int /** * Returns a local date-time formed from this date at the specified time. - * - * @param LocalTime $time - * - * @return LocalDateTime */ public function atTime(LocalTime $time) : LocalDateTime { @@ -746,8 +608,6 @@ public function atTime(LocalTime $time) : LocalDateTime /** * Checks if the year is a leap year, according to the ISO proleptic calendar system rules. - * - * @return bool */ public function isLeapYear() : bool { @@ -755,9 +615,7 @@ public function isLeapYear() : bool } /** - * Returns the length of the year represented by this date. - * - * @return int The length of the year in days. + * Returns the length of the year represented by this date, in days. */ public function getLengthOfYear() : int { @@ -765,9 +623,7 @@ public function getLengthOfYear() : int } /** - * Returns the length of the month represented by this date. - * - * @return int The length of the month in days. + * Returns the length of the month represented by this date, in days. */ public function getLengthOfMonth() : int { @@ -776,8 +632,6 @@ public function getLengthOfMonth() : int /** * Returns the number of days since the UNIX epoch of 1st January 1970. - * - * @return int */ public function toEpochDay() : int { @@ -809,8 +663,6 @@ public function toEpochDay() : int * Converts this LocalDate to a native DateTime object. * * The result is a DateTime with time 00:00 in the UTC time-zone. - * - * @return \DateTime */ public function toDateTime() : \DateTime { @@ -818,7 +670,9 @@ public function toDateTime() : \DateTime } /** - * @return \DateTimeImmutable + * Converts this LocalDate to a native DateTimeImmutable object. + * + * The result is a DateTimeImmutable with time 00:00 in the UTC time-zone. */ public function toDateTimeImmutable() : \DateTimeImmutable { @@ -827,8 +681,6 @@ public function toDateTimeImmutable() : \DateTimeImmutable /** * Returns the ISO 8601 representation of this LocalDate. - * - * @return string */ public function __toString() : string { @@ -843,8 +695,6 @@ public function __toString() : string * @param int $year The year to represent, validated from MIN_YEAR to MAX_YEAR. * @param int $month The month-of-year to represent, validated from 1 to 12. * @param int $day The day-of-month to represent, validated from 1 to 31. - * - * @return LocalDate */ private function resolvePreviousValid(int $year, int $month, int $day) : LocalDate { @@ -857,17 +707,12 @@ private function resolvePreviousValid(int $year, int $month, int $day) : LocalDa /** * Serializes as a string using {@see LocalDate::__toString()}. - * - * @return string */ public function jsonSerialize() : string { return (string) $this; } - /** - * @return int - */ private function getProlepticMonth() : int { return $this->year * 12 + $this->month - 1; diff --git a/src/LocalDateRange.php b/src/LocalDateRange.php index 49a3512..83c2de2 100644 --- a/src/LocalDateRange.php +++ b/src/LocalDateRange.php @@ -21,20 +21,18 @@ final class LocalDateRange implements \IteratorAggregate, \Countable, \JsonSeria /** * The start date, inclusive. * - * @var \Brick\DateTime\LocalDate + * @var LocalDate */ private $start; /** * The end date, inclusive. * - * @var \Brick\DateTime\LocalDate + * @var LocalDate */ private $end; /** - * Class constructor. - * * @param LocalDate $start The start date, inclusive. * @param LocalDate $end The end date, inclusive, validated as not before the start date. */ @@ -50,8 +48,6 @@ private function __construct(LocalDate $start, LocalDate $end) * @param LocalDate $start The start date, inclusive. * @param LocalDate $end The end date, inclusive. * - * @return LocalDateRange - * * @throws DateTimeException If the end date is before the start date. */ public static function of(LocalDate $start, LocalDate $end) : LocalDateRange @@ -68,10 +64,6 @@ public static function of(LocalDate $start, LocalDate $end) : LocalDateRange * * This method is only useful to parsers. * - * @param DateTimeParseResult $result - * - * @return LocalDateRange - * * @throws DateTimeException If the date range is not valid. * @throws DateTimeParseException If required fields are missing from the result. */ @@ -104,8 +96,6 @@ public static function from(DateTimeParseResult $result) : LocalDateRange * @param string $text The text to parse. * @param DateTimeParser|null $parser The parser to use, defaults to the ISO 8601 parser. * - * @return LocalDateRange - * * @throws DateTimeException If either of the dates is not valid. * @throws DateTimeParseException If the text string does not follow the expected format. */ @@ -120,8 +110,6 @@ public static function parse(string $text, ?DateTimeParser $parser = null) : Loc /** * Returns the start date, inclusive. - * - * @return LocalDate */ public function getStart() : LocalDate { @@ -130,8 +118,6 @@ public function getStart() : LocalDate /** * Returns the end date, inclusive. - * - * @return LocalDate */ public function getEnd() : LocalDate { @@ -165,10 +151,6 @@ public function contains(LocalDate $date) : bool /** * Returns whether this LocalDateRange intersects with the given date range. - * - * @param LocalDateRange $that - * - * @return bool */ public function intersectsWith(LocalDateRange $that) : bool { @@ -181,10 +163,6 @@ public function intersectsWith(LocalDateRange $that) : bool /** * Returns the intersection of this LocalDateRange with the given date range. * - * @param LocalDateRange $that - * - * @return LocalDateRange - * * @throws DateTimeException If the ranges do not intersect. */ public function getIntersectionWith(LocalDateRange $that) : LocalDateRange @@ -223,8 +201,6 @@ public function count() : int /** * Serializes as a string using {@see LocalDateRange::__toString()}. - * - * @return string */ public function jsonSerialize() : string { @@ -234,10 +210,8 @@ public function jsonSerialize() : string /** * Converts this LocalDateRange to a native DatePeriod object. * - * The result is a DatePeriod->start with time 00:00 and a DatePeriod->end + * The result is a DatePeriod->start with time 00:00 and a DatePeriod->end * with time 23:59:59.999999 in the UTC time-zone. - * - * @return \DatePeriod */ public function toDatePeriod() : \DatePeriod { @@ -250,8 +224,6 @@ public function toDatePeriod() : \DatePeriod /** * Returns an ISO 8601 string representation of this date range. - * - * @return string */ public function __toString() : string { diff --git a/src/LocalDateTime.php b/src/LocalDateTime.php index b3f4075..2cc475b 100644 --- a/src/LocalDateTime.php +++ b/src/LocalDateTime.php @@ -27,12 +27,6 @@ final class LocalDateTime implements \JsonSerializable */ private $time; - /** - * Class constructor. - * - * @param LocalDate $date - * @param LocalTime $time - */ public function __construct(LocalDate $date, LocalTime $time) { $this->date = $date; @@ -48,8 +42,6 @@ public function __construct(LocalDate $date, LocalTime $time) * @param int $second The second-of-minute, from 0 to 59. * @param int $nano The nano-of-second, from 0 to 999,999,999. * - * @return LocalDateTime - * * @throws DateTimeException If the date or time is not valid. */ public static function of(int $year, int $month, int $day, int $hour = 0, int $minute = 0, int $second = 0, int $nano = 0) : LocalDateTime @@ -64,11 +56,6 @@ public static function of(int $year, int $month, int $day, int $hour = 0, int $m * Returns the current local date-time in the given time-zone, according to the given clock. * * If no clock is provided, the system clock is used. - * - * @param TimeZone $timeZone - * @param Clock|null $clock - * - * @return LocalDateTime */ public static function now(TimeZone $timeZone, ?Clock $clock = null) : LocalDateTime { @@ -76,10 +63,6 @@ public static function now(TimeZone $timeZone, ?Clock $clock = null) : LocalDate } /** - * @param DateTimeParseResult $result - * - * @return LocalDateTime - * * @throws DateTimeException If the date-time is not valid. * @throws DateTimeParseException If required fields are missing from the result. */ @@ -97,8 +80,6 @@ public static function from(DateTimeParseResult $result) : LocalDateTime * @param string $text The text to parse, such as `2007-12-03T10:15:30`. * @param DateTimeParser|null $parser The parser to use, defaults to the ISO 8601 parser. * - * @return LocalDateTime - * * @throws DateTimeException If the date-time is not valid. * @throws DateTimeParseException If the text string does not follow the expected format. */ @@ -113,10 +94,6 @@ public static function parse(string $text, ?DateTimeParser $parser = null) : Loc /** * Creates a LocalDateTime from a native DateTime or DateTimeImmutable object. - * - * @param \DateTimeInterface $dateTime - * - * @return LocalDateTime */ public static function fromDateTime(\DateTimeInterface $dateTime) : LocalDateTime { @@ -128,8 +105,6 @@ public static function fromDateTime(\DateTimeInterface $dateTime) : LocalDateTim /** * Returns the smallest possible value for LocalDateTime. - * - * @return LocalDateTime */ public static function min() : LocalDateTime { @@ -138,8 +113,6 @@ public static function min() : LocalDateTime /** * Returns the highest possible value for LocalDateTime. - * - * @return LocalDateTime */ public static function max() : LocalDateTime { @@ -198,89 +171,56 @@ public static function maxOf(LocalDateTime ...$times) : LocalDateTime return $max; } - /** - * @return LocalDate - */ public function getDate() : LocalDate { return $this->date; } - /** - * @return LocalTime - */ public function getTime() : LocalTime { return $this->time; } - /** - * @return int - */ public function getYear() : int { return $this->date->getYear(); } - /** - * @return int - */ public function getMonth() : int { return $this->date->getMonth(); } - /** - * @return int - */ public function getDay() : int { return $this->date->getDay(); } - /** - * @return DayOfWeek - */ public function getDayOfWeek() : DayOfWeek { return $this->date->getDayOfWeek(); } - /** - * @return int - */ public function getDayOfYear() : int { return $this->date->getDayOfYear(); } - /** - * @return int - */ public function getHour() : int { return $this->time->getHour(); } - /** - * @return int - */ public function getMinute() : int { return $this->time->getMinute(); } - /** - * @return int - */ public function getSecond() : int { return $this->time->getSecond(); } - /** - * @return int - */ public function getNano() : int { return $this->time->getNano(); @@ -288,10 +228,6 @@ public function getNano() : int /** * Returns a copy of this LocalDateTime with the date altered. - * - * @param LocalDate $date - * - * @return LocalDateTime */ public function withDate(LocalDate $date) : LocalDateTime { @@ -304,10 +240,6 @@ public function withDate(LocalDate $date) : LocalDateTime /** * Returns a copy of this LocalDateTime with the time altered. - * - * @param LocalTime $time - * - * @return LocalDateTime */ public function withTime(LocalTime $time) : LocalDateTime { @@ -323,10 +255,6 @@ public function withTime(LocalTime $time) : LocalDateTime * * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month. * - * @param int $year - * - * @return LocalDateTime - * * @throws DateTimeException If the year is outside the valid range. */ public function withYear(int $year) : LocalDateTime @@ -345,10 +273,6 @@ public function withYear(int $year) : LocalDateTime * * If the day-of-month is invalid for the month and year, it will be changed to the last valid day of the month. * - * @param int $month - * - * @return LocalDateTime - * * @throws DateTimeException If the month is invalid. */ public function withMonth(int $month) : LocalDateTime @@ -367,10 +291,6 @@ public function withMonth(int $month) : LocalDateTime * * If the resulting date is invalid, an exception is thrown. * - * @param int $day - * - * @return LocalDateTime - * * @throws DateTimeException If the day is invalid for the current year and month. */ public function withDay(int $day) : LocalDateTime @@ -387,10 +307,6 @@ public function withDay(int $day) : LocalDateTime /** * Returns a copy of this LocalDateTime with the hour-of-day altered. * - * @param int $hour - * - * @return LocalDateTime - * * @throws DateTimeException If the hour is invalid. */ public function withHour(int $hour) : LocalDateTime @@ -407,10 +323,6 @@ public function withHour(int $hour) : LocalDateTime /** * Returns a copy of this LocalDateTime with the minute-of-hour altered. * - * @param int $minute - * - * @return LocalDateTime - * * @throws DateTimeException If the minute-of-hour if not valid. */ public function withMinute(int $minute) : LocalDateTime @@ -427,10 +339,6 @@ public function withMinute(int $minute) : LocalDateTime /** * Returns a copy of this LocalDateTime with the second-of-minute altered. * - * @param int $second - * - * @return LocalDateTime - * * @throws DateTimeException If the second-of-minute if not valid. */ public function withSecond(int $second) : LocalDateTime @@ -447,10 +355,6 @@ public function withSecond(int $second) : LocalDateTime /** * Returns a copy of this LocalDateTime with the nano-of-second altered. * - * @param int $nano - * - * @return LocalDateTime - * * @throws DateTimeException If the nano-of-second if not valid. */ public function withNano(int $nano) : LocalDateTime @@ -478,10 +382,6 @@ public function atTimeZone(TimeZone $zone) : ZonedDateTime /** * Returns a copy of this LocalDateTime with the specified Period added. - * - * @param Period $period - * - * @return LocalDateTime */ public function plusPeriod(Period $period) : LocalDateTime { @@ -496,10 +396,6 @@ public function plusPeriod(Period $period) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specific Duration added. - * - * @param Duration $duration - * - * @return LocalDateTime */ public function plusDuration(Duration $duration) : LocalDateTime { @@ -515,10 +411,6 @@ public function plusDuration(Duration $duration) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specified period in years added. * - * @param int $years - * - * @return LocalDateTime - * * @throws DateTimeException If the resulting year is out of range. */ public function plusYears(int $years) : LocalDateTime @@ -532,10 +424,6 @@ public function plusYears(int $years) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specified period in months added. - * - * @param int $months - * - * @return LocalDateTime */ public function plusMonths(int $months) : LocalDateTime { @@ -548,10 +436,6 @@ public function plusMonths(int $months) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specified period in weeks added. - * - * @param int $weeks - * - * @return LocalDateTime */ public function plusWeeks(int $weeks) : LocalDateTime { @@ -564,10 +448,6 @@ public function plusWeeks(int $weeks) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specified period in days added. - * - * @param int $days - * - * @return LocalDateTime */ public function plusDays(int $days) : LocalDateTime { @@ -580,10 +460,6 @@ public function plusDays(int $days) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specified period in hours added. - * - * @param int $hours - * - * @return LocalDateTime */ public function plusHours(int $hours) : LocalDateTime { @@ -596,10 +472,6 @@ public function plusHours(int $hours) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specified period in minutes added. - * - * @param int $minutes - * - * @return LocalDateTime */ public function plusMinutes(int $minutes) : LocalDateTime { @@ -612,10 +484,6 @@ public function plusMinutes(int $minutes) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specified period in seconds added. - * - * @param int $seconds - * - * @return LocalDateTime */ public function plusSeconds(int $seconds) : LocalDateTime { @@ -628,10 +496,6 @@ public function plusSeconds(int $seconds) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specified period in nanoseconds added. - * - * @param int $nanos - * - * @return LocalDateTime */ public function plusNanos(int $nanos) : LocalDateTime { @@ -644,10 +508,6 @@ public function plusNanos(int $nanos) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specified Period subtracted. - * - * @param Period $period - * - * @return LocalDateTime */ public function minusPeriod(Period $period) : LocalDateTime { @@ -656,10 +516,6 @@ public function minusPeriod(Period $period) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specific Duration subtracted. - * - * @param Duration $duration - * - * @return LocalDateTime */ public function minusDuration(Duration $duration) : LocalDateTime { @@ -668,10 +524,6 @@ public function minusDuration(Duration $duration) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specified period in years subtracted. - * - * @param int $years - * - * @return LocalDateTime */ public function minusYears(int $years) : LocalDateTime { @@ -684,10 +536,6 @@ public function minusYears(int $years) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specified period in months subtracted. - * - * @param int $months - * - * @return LocalDateTime */ public function minusMonths(int $months) : LocalDateTime { @@ -700,10 +548,6 @@ public function minusMonths(int $months) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specified period in weeks subtracted. - * - * @param int $weeks - * - * @return LocalDateTime */ public function minusWeeks(int $weeks) : LocalDateTime { @@ -716,10 +560,6 @@ public function minusWeeks(int $weeks) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specified period in days subtracted. - * - * @param int $days - * - * @return LocalDateTime */ public function minusDays(int $days) : LocalDateTime { @@ -732,10 +572,6 @@ public function minusDays(int $days) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specified period in hours subtracted. - * - * @param int $hours - * - * @return LocalDateTime */ public function minusHours(int $hours) : LocalDateTime { @@ -748,10 +584,6 @@ public function minusHours(int $hours) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specified period in minutes subtracted. - * - * @param int $minutes - * - * @return LocalDateTime */ public function minusMinutes(int $minutes) : LocalDateTime { @@ -780,10 +612,6 @@ public function minusSeconds(int $seconds) : LocalDateTime /** * Returns a copy of this LocalDateTime with the specified period in nanoseconds subtracted. - * - * @param int $nanos - * - * @return LocalDateTime */ public function minusNanos(int $nanos) : LocalDateTime { @@ -846,51 +674,26 @@ public function compareTo(LocalDateTime $that) : int return $this->date->compareTo($that->date) ?: $this->time->compareTo($that->time); } - /** - * @param LocalDateTime $that - * - * @return bool - */ public function isEqualTo(LocalDateTime $that) : bool { return $this->compareTo($that) === 0; } - /** - * @param LocalDateTime $that - * - * @return bool - */ public function isBefore(LocalDateTime $that) : bool { return $this->compareTo($that) === -1; } - /** - * @param LocalDateTime $that - * - * @return bool - */ public function isBeforeOrEqualTo(LocalDateTime $that) : bool { return $this->compareTo($that) <= 0; } - /** - * @param LocalDateTime $that - * - * @return bool - */ public function isAfter(LocalDateTime $that) : bool { return $this->compareTo($that) === 1; } - /** - * @param LocalDateTime $that - * - * @return bool - */ public function isAfterOrEqualTo(LocalDateTime $that) : bool { return $this->compareTo($that) >= 0; @@ -900,11 +703,6 @@ public function isAfterOrEqualTo(LocalDateTime $that) : bool * Returns whether this LocalDateTime is in the future, in the given time-zone, according to the given clock. * * If no clock is provided, the system clock is used. - * - * @param TimeZone $timeZone - * @param Clock|null $clock - * - * @return bool */ public function isFuture(TimeZone $timeZone, ?Clock $clock = null) : bool { @@ -915,11 +713,6 @@ public function isFuture(TimeZone $timeZone, ?Clock $clock = null) : bool * Returns whether this LocalDateTime is in the past, in the given time-zone, according to the given clock. * * If no clock is provided, the system clock is used. - * - * @param TimeZone $timeZone - * @param Clock|null $clock - * - * @return bool */ public function isPast(TimeZone $timeZone, ?Clock $clock = null) : bool { @@ -933,8 +726,6 @@ public function isPast(TimeZone $timeZone, ?Clock $clock = null) : bool * * Note that the native DateTime object supports a precision up to the microsecond, * so the nanoseconds are rounded down to the nearest microsecond. - * - * @return \DateTime */ public function toDateTime() : \DateTime { @@ -942,7 +733,12 @@ public function toDateTime() : \DateTime } /** - * @return \DateTimeImmutable + * Converts this LocalDateTime to a native DateTimeImmutable object. + * + * The result is a DateTimeImmutable in the UTC time-zone. + * + * Note that the native DateTimeImmutable object supports a precision up to the microsecond, + * so the nanoseconds are rounded down to the nearest microsecond. */ public function toDateTimeImmutable() : \DateTimeImmutable { @@ -951,17 +747,12 @@ public function toDateTimeImmutable() : \DateTimeImmutable /** * Serializes as a string using {@see LocalDateTime::__toString()}. - * - * @return string */ public function jsonSerialize() : string { return (string) $this; } - /** - * @return string - */ public function __toString() : string { return $this->date . 'T' . $this->time; diff --git a/src/LocalTime.php b/src/LocalTime.php index 0b5aca4..30b8420 100644 --- a/src/LocalTime.php +++ b/src/LocalTime.php @@ -82,8 +82,6 @@ private function __construct(int $hour, int $minute, int $second, int $nano) * @param int $second The second, from 0 to 59. * @param int $nano The nano-of-second, from 0 to 999,999,999. * - * @return LocalTime - * * @throws DateTimeException */ public static function of(int $hour, int $minute, int $second = 0, int $nano = 0) : LocalTime @@ -102,8 +100,6 @@ public static function of(int $hour, int $minute, int $second = 0, int $nano = 0 * @param int $secondOfDay The second-of-day, from 0 to 86,399. * @param int $nanoOfSecond The nano-of-second, from 0 to 999,999,999. * - * @return LocalTime - * * @throws DateTimeException */ public static function ofSecondOfDay(int $secondOfDay, int $nanoOfSecond = 0) : LocalTime @@ -120,10 +116,6 @@ public static function ofSecondOfDay(int $secondOfDay, int $nanoOfSecond = 0) : } /** - * @param DateTimeParseResult $result - * - * @return LocalTime - * * @throws DateTimeException If the time is not valid. * @throws DateTimeParseException If required fields are missing from the result. */ @@ -145,8 +137,6 @@ public static function from(DateTimeParseResult $result) : LocalTime * @param string $text The text to parse, such as `10:15`. * @param DateTimeParser|null $parser The parser to use, defaults to the ISO 8601 parser. * - * @return LocalTime - * * @throws DateTimeException If the time is not valid. * @throws DateTimeParseException If the text string does not follow the expected format. */ @@ -161,10 +151,6 @@ public static function parse(string $text, ?DateTimeParser $parser = null) : Loc /** * Creates a LocalTime from a native DateTime or DateTimeImmutable object. - * - * @param \DateTimeInterface $dateTime - * - * @return LocalTime */ public static function fromDateTime(\DateTimeInterface $dateTime) : LocalTime { @@ -180,28 +166,17 @@ public static function fromDateTime(\DateTimeInterface $dateTime) : LocalTime * Returns the current local time in the given time-zone, according to the given clock. * * If no clock is provided, the system clock is used. - * - * @param TimeZone $timeZone - * @param Clock|null $clock - * - * @return LocalTime */ public static function now(TimeZone $timeZone, ?Clock $clock = null) : LocalTime { return ZonedDateTime::now($timeZone, $clock)->getTime(); } - /** - * @return LocalTime - */ public static function midnight() : LocalTime { return new LocalTime(0, 0, 0, 0); } - /** - * @return LocalTime - */ public static function noon() : LocalTime { return new LocalTime(12, 0, 0, 0); @@ -209,8 +184,6 @@ public static function noon() : LocalTime /** * Returns the smallest possible value for LocalTime. - * - * @return LocalTime */ public static function min() : LocalTime { @@ -219,8 +192,6 @@ public static function min() : LocalTime /** * Returns the highest possible value for LocalTime. - * - * @return LocalTime */ public static function max() : LocalTime { @@ -279,33 +250,21 @@ public static function maxOf(LocalTime ...$times) : LocalTime return $max; } - /** - * @return int - */ public function getHour() : int { return $this->hour; } - /** - * @return int - */ public function getMinute() : int { return $this->minute; } - /** - * @return int - */ public function getSecond() : int { return $this->second; } - /** - * @return int - */ public function getNano() : int { return $this->nano; @@ -316,8 +275,6 @@ public function getNano() : int * * @param int $hour The new hour-of-day. * - * @return LocalTime - * * @throws DateTimeException If the hour-of-day if not valid. */ public function withHour(int $hour) : LocalTime @@ -336,8 +293,6 @@ public function withHour(int $hour) : LocalTime * * @param int $minute The new minute-of-hour. * - * @return LocalTime - * * @throws DateTimeException If the minute-of-hour if not valid. */ public function withMinute(int $minute) : LocalTime @@ -356,8 +311,6 @@ public function withMinute(int $minute) : LocalTime * * @param int $second The new second-of-minute. * - * @return LocalTime - * * @throws DateTimeException If the second-of-minute if not valid. */ public function withSecond(int $second) : LocalTime @@ -376,8 +329,6 @@ public function withSecond(int $second) : LocalTime * * @param int $nano The new nano-of-second. * - * @return LocalTime - * * @throws DateTimeException If the nano-of-second if not valid. */ public function withNano(int $nano) : LocalTime @@ -395,10 +346,6 @@ public function withNano(int $nano) : LocalTime * Returns a copy of this LocalTime with the specific duration added. * * The calculation wraps around midnight. - * - * @param Duration $duration - * - * @return LocalTime */ public function plusDuration(Duration $duration) : LocalTime { @@ -524,51 +471,27 @@ public function plusNanos(int $nanos) : LocalTime * Returns a copy of this LocalTime with the specific duration subtracted. * * The calculation wraps around midnight. - * - * @param Duration $duration - * - * @return LocalTime */ public function minusDuration(Duration $duration) : LocalTime { return $this->plusDuration($duration->negated()); } - /** - * @param int $hours - * - * @return LocalTime - */ public function minusHours(int $hours) : LocalTime { return $this->plusHours(- $hours); } - /** - * @param int $minutes - * - * @return LocalTime - */ public function minusMinutes(int $minutes) : LocalTime { return $this->plusMinutes(- $minutes); } - /** - * @param int $seconds - * - * @return LocalTime - */ public function minusSeconds(int $seconds) : LocalTime { return $this->plusSeconds(- $seconds); } - /** - * @param int $nanos - * - * @return LocalTime - */ public function minusNanos(int $nanos) : LocalTime { return $this->plusNanos(-$nanos); @@ -602,8 +525,6 @@ public function compareTo(LocalTime $that) : int * Checks if this LocalTime is equal to the specified time. * * @param LocalTime $that The time to compare to. - * - * @return bool */ public function isEqualTo(LocalTime $that) : bool { @@ -614,8 +535,6 @@ public function isEqualTo(LocalTime $that) : bool * Checks if this LocalTime is less than the specified time. * * @param LocalTime $that The time to compare to. - * - * @return bool */ public function isBefore(LocalTime $that) : bool { @@ -626,8 +545,6 @@ public function isBefore(LocalTime $that) : bool * Checks if this LocalTime is less than the specified time. * * @param LocalTime $that The time to compare to. - * - * @return bool */ public function isBeforeOrEqualTo(LocalTime $that) : bool { @@ -638,8 +555,6 @@ public function isBeforeOrEqualTo(LocalTime $that) : bool * Checks if this LocalTime is greater than the specified time. * * @param LocalTime $that The time to compare to. - * - * @return bool */ public function isAfter(LocalTime $that) : bool { @@ -650,8 +565,6 @@ public function isAfter(LocalTime $that) : bool * Checks if this LocalTime is greater than the specified time. * * @param LocalTime $that The time to compare to. - * - * @return bool */ public function isAfterOrEqualTo(LocalTime $that) : bool { @@ -660,10 +573,6 @@ public function isAfterOrEqualTo(LocalTime $that) : bool /** * Combines this time with a date to create a LocalDateTime. - * - * @param LocalDate $date - * - * @return LocalDateTime */ public function atDate(LocalDate $date) : LocalDateTime { @@ -674,8 +583,6 @@ public function atDate(LocalDate $date) : LocalDateTime * Returns the time as seconds of day, from 0 to 24 * 60 * 60 - 1. * * This does not include the nanoseconds. - * - * @return int */ public function toSecondOfDay() : int { @@ -691,8 +598,6 @@ public function toSecondOfDay() : int * * Note that the native DateTime object supports a precision up to the microsecond, * so the nanoseconds are rounded down to the nearest microsecond. - * - * @return \DateTime */ public function toDateTime() : \DateTime { @@ -700,7 +605,12 @@ public function toDateTime() : \DateTime } /** - * @return \DateTimeImmutable + * Converts this LocalTime to a native DateTimeImmutable object. + * + * The result is a DateTimeImmutable with date 0000-01-01 in the UTC time-zone. + * + * Note that the native DateTimeImmutable object supports a precision up to the microsecond, + * so the nanoseconds are rounded down to the nearest microsecond. */ public function toDateTimeImmutable() : \DateTimeImmutable { @@ -709,8 +619,6 @@ public function toDateTimeImmutable() : \DateTimeImmutable /** * Serializes as a string using {@see LocalTime::__toString()}. - * - * @return string */ public function jsonSerialize() : string { @@ -729,8 +637,6 @@ public function jsonSerialize() : string * The format used will be the shortest that outputs the full value of * the time where the omitted parts are implied to be zero. * The nanoseconds value, if present, can be 0 to 9 digits. - * - * @return string A string representation of this time. */ public function __toString() : string { diff --git a/src/Month.php b/src/Month.php index 7f47736..b9d2ea0 100644 --- a/src/Month.php +++ b/src/Month.php @@ -114,10 +114,6 @@ public function is(int $month) : bool /** * Returns whether this Month equals another Month. - * - * @param Month $that - * - * @return bool */ public function isEqualTo(Month $that) : bool { @@ -169,10 +165,6 @@ public function getMaxLength() : int * * This returns the day-of-year that this month begins on, using the leap * year flag to determine the length of February. - * - * @param bool $leapYear - * - * @return int */ public function getFirstDayOfYear(bool $leapYear) : int { @@ -214,10 +206,6 @@ public function getFirstDayOfYear(bool $leapYear) : int * February has 28 days in a standard year and 29 days in a leap year. * April, June, September and November have 30 days. * All other months have 31 days. - * - * @param bool $leapYear - * - * @return int */ public function getLength(bool $leapYear) : int { @@ -239,10 +227,6 @@ public function getLength(bool $leapYear) : int * * The calculation rolls around the end of the year from December to January. * The specified period may be negative. - * - * @param int $months - * - * @return Month */ public function plus(int $months) : Month { @@ -254,10 +238,6 @@ public function plus(int $months) : Month * * The calculation rolls around the start of the year from January to December. * The specified period may be negative. - * - * @param int $months - * - * @return Month */ public function minus(int $months) : Month { @@ -266,8 +246,6 @@ public function minus(int $months) : Month /** * Serializes as a string using {@see Month::__toString()}. - * - * @return string */ public function jsonSerialize() : string { @@ -276,10 +254,8 @@ public function jsonSerialize() : string /** * Returns the capitalized English name of this Month. - * - * @return string */ - public function __toString() + public function __toString() : string { return [ 1 => 'January', diff --git a/src/MonthDay.php b/src/MonthDay.php index 54d10c0..45a634a 100644 --- a/src/MonthDay.php +++ b/src/MonthDay.php @@ -46,8 +46,6 @@ private function __construct(int $month, int $day) * @param int $month The month-of-year, from 1 (January) to 12 (December). * @param int $day The day-of-month, from 1 to 31. * - * @return MonthDay - * * @throws DateTimeException If the month-day is not valid. */ public static function of(int $month, int $day) : MonthDay @@ -59,10 +57,6 @@ public static function of(int $month, int $day) : MonthDay } /** - * @param DateTimeParseResult $result - * - * @return MonthDay - * * @throws DateTimeException If the month-day is not valid. * @throws DateTimeParseException If required fields are missing from the result. */ @@ -80,8 +74,6 @@ public static function from(DateTimeParseResult $result) : MonthDay * @param string $text The text to parse, such as `--12-03`. * @param DateTimeParser|null $parser The parser to use, defaults to the ISO 8601 parser. * - * @return MonthDay - * * @throws DateTimeException If the date is not valid. * @throws DateTimeParseException If the text string does not follow the expected format. */ @@ -98,11 +90,6 @@ public static function parse(string $text, ?DateTimeParser $parser = null) : Mon * Returns the current month-day in the given time-zone, according to the given clock. * * If no clock is provided, the system clock is used. - * - * @param TimeZone $timeZone - * @param Clock|null $clock - * - * @return MonthDay */ public static function now(TimeZone $timeZone, ?Clock $clock = null) : MonthDay { @@ -113,8 +100,6 @@ public static function now(TimeZone $timeZone, ?Clock $clock = null) : MonthDay /** * Returns the month-of-year. - * - * @return int */ public function getMonth() : int { @@ -123,8 +108,6 @@ public function getMonth() : int /** * Returns the day-of-month. - * - * @return int */ public function getDay() : int { @@ -134,8 +117,6 @@ public function getDay() : int /** * Returns -1 if this date is before the given date, 1 if after, 0 if the dates are equal. * - * @param MonthDay $that - * * @return int [-1,0,1] If this date is before, on, or after the given date. */ public function compareTo(MonthDay $that) : int @@ -158,10 +139,6 @@ public function compareTo(MonthDay $that) : int /** * Returns whether this month-day is equal to the specified month-day. - * - * @param MonthDay $that - * - * @return bool */ public function isEqualTo(MonthDay $that) : bool { @@ -170,10 +147,6 @@ public function isEqualTo(MonthDay $that) : bool /** * Returns whether this month-day is before the specified month-day. - * - * @param MonthDay $that - * - * @return bool */ public function isBefore(MonthDay $that) : bool { @@ -182,10 +155,6 @@ public function isBefore(MonthDay $that) : bool /** * Returns whether this month-day is after the specified month-day. - * - * @param MonthDay $that - * - * @return bool */ public function isAfter(MonthDay $that) : bool { @@ -197,10 +166,6 @@ public function isAfter(MonthDay $that) : bool * * This method checks whether this month and day and the input year form a valid date. * This can only return false for February 29th. - * - * @param int $year - * - * @return bool */ public function isValidYear(int $year) : bool { @@ -213,10 +178,6 @@ public function isValidYear(int $year) : bool * If the day-of-month is invalid for the specified month, the day will * be adjusted to the last valid day-of-month. * - * @param int $month - * - * @return MonthDay - * * @throws DateTimeException If the month is invalid. */ public function withMonth(int $month) : MonthDay @@ -237,10 +198,6 @@ public function withMonth(int $month) : MonthDay * * If the day-of-month is invalid for the month, an exception is thrown. * - * @param int $day - * - * @return MonthDay - * * @throws DateTimeException If the day-of-month is invalid for the month. */ public function withDay(int $day) : MonthDay @@ -262,10 +219,6 @@ public function withDay(int $day) : MonthDay * A month-day of February 29th will be adjusted to February 28th * in the resulting date if the year is not a leap year. * - * @param int $year - * - * @return LocalDate - * * @throws DateTimeException If the year is invalid. */ public function atYear(int $year) : LocalDate @@ -275,17 +228,12 @@ public function atYear(int $year) : LocalDate /** * Serializes as a string using {@see MonthDay::__toString()}. - * - * @return string */ public function jsonSerialize() : string { return (string) $this; } - /** - * @return string - */ public function __toString() : string { return \sprintf('--%02d-%02d', $this->month, $this->day); diff --git a/src/Parser/DateTimeParseException.php b/src/Parser/DateTimeParseException.php index 02bb0de..b484bbe 100644 --- a/src/Parser/DateTimeParseException.php +++ b/src/Parser/DateTimeParseException.php @@ -11,20 +11,11 @@ */ class DateTimeParseException extends DateTimeException { - /** - * @param string $textToParse - * - * @return DateTimeParseException - */ public static function invalidDuration(string $textToParse) : self { return new self('Text cannot be parsed to a Duration: ' . $textToParse); } - /** - * @param string $textToParse - * - * @return DateTimeParseException - */ + public static function invalidPeriod(string $textToParse) : self { return new self('Text cannot be parsed to a Period: ' . $textToParse); diff --git a/src/Parser/DateTimeParseResult.php b/src/Parser/DateTimeParseResult.php index 3e099c8..25a18ac 100644 --- a/src/Parser/DateTimeParseResult.php +++ b/src/Parser/DateTimeParseResult.php @@ -14,12 +14,6 @@ final class DateTimeParseResult */ private $fields = []; - /** - * @param string $name - * @param string $value - * - * @return void - */ public function addField(string $name, string $value) : void { $this->fields[$name][] = $value; @@ -27,10 +21,6 @@ public function addField(string $name, string $value) : void /** * Returns whether this result has at least one value for the given field. - * - * @param string $name - * - * @return bool */ public function hasField(string $name) : bool { @@ -59,10 +49,6 @@ public function getField(string $name) : string /** * Returns the first value for the given field, or an empty string if not present. - * - * @param string $name - * - * @return string */ public function getOptionalField(string $name) : string { diff --git a/src/Parser/IsoParsers.php b/src/Parser/IsoParsers.php index aaa77c9..8964949 100644 --- a/src/Parser/IsoParsers.php +++ b/src/Parser/IsoParsers.php @@ -31,8 +31,6 @@ private function __construct() /** * Returns a parser for an ISO local date such as `2014-12-31`. - * - * @return PatternParser */ public static function localDate() : PatternParser { @@ -56,8 +54,6 @@ public static function localDate() : PatternParser * Returns a parser for an ISO local time such as `10:15:30.123`. * * The second and fraction of second are optional. - * - * @return PatternParser */ public static function localTime() : PatternParser { @@ -87,8 +83,6 @@ public static function localTime() : PatternParser * Returns a parser for an ISO local date-time such as `2014-12-31T10:15`. * * The second and fraction of second are optional. - * - * @return PatternParser */ public static function localDateTime() : PatternParser { @@ -108,8 +102,6 @@ public static function localDateTime() : PatternParser /** * Returns a parser for a range of local dates such as `2014-01-05/2015-03-15`. - * - * @return PatternParser */ public static function localDateRange() : PatternParser { @@ -146,8 +138,6 @@ public static function localDateRange() : PatternParser * * Note that ISO 8601 does not seem to define a format for year-month ranges, but we're using the same format as * date ranges here. - * - * @return PatternParser */ public static function yearMonthRange() : PatternParser { @@ -177,8 +167,6 @@ public static function yearMonthRange() : PatternParser /** * Returns a parser for a year-month such as `2014-12`. - * - * @return PatternParser */ public static function yearMonth() : PatternParser { @@ -198,8 +186,6 @@ public static function yearMonth() : PatternParser /** * Returns a parser for a month-day such as `12-31`. - * - * @return PatternParser */ public static function monthDay() : PatternParser { @@ -220,8 +206,6 @@ public static function monthDay() : PatternParser /** * Returns a parser for a time-zone offset such as `Z` or `+01:00`. - * - * @return PatternParser */ public static function timeZoneOffset() : PatternParser { @@ -252,8 +236,6 @@ public static function timeZoneOffset() : PatternParser /** * Returns a parser for a time-zone region such as `Europe/London`. - * - * @return PatternParser */ public static function timeZoneRegion() : PatternParser { @@ -271,8 +253,6 @@ public static function timeZoneRegion() : PatternParser /** * Returns a parser for an offset date-time such as `2004-01-31T12:45:56+01:00`. - * - * @return PatternParser */ public static function offsetDateTime() : PatternParser { @@ -291,8 +271,6 @@ public static function offsetDateTime() : PatternParser /** * Returns a parser for a date-time with offset and zone such as `2011-12-03T10:15:30+01:00[Europe/Paris]. - * - * @return PatternParser */ public static function zonedDateTime() : PatternParser { diff --git a/src/Parser/PatternParser.php b/src/Parser/PatternParser.php index 919a122..a183517 100644 --- a/src/Parser/PatternParser.php +++ b/src/Parser/PatternParser.php @@ -29,9 +29,6 @@ public function __construct(string $pattern, array $fields) $this->fields = $fields; } - /** - * @return string - */ public function getPattern() : string { return $this->pattern; @@ -45,9 +42,6 @@ public function getFields() : array return $this->fields; } - /** - * {@inheritdoc} - */ public function parse(string $text) : DateTimeParseResult { $pattern = '/^' . $this->pattern . '$/'; diff --git a/src/Parser/PatternParserBuilder.php b/src/Parser/PatternParserBuilder.php index 331f59e..bd34405 100644 --- a/src/Parser/PatternParserBuilder.php +++ b/src/Parser/PatternParserBuilder.php @@ -24,11 +24,6 @@ final class PatternParserBuilder */ private $stack = []; - /** - * @param PatternParser $parser - * - * @return self - */ public function append(PatternParser $parser) : self { $this->pattern .= $parser->getPattern(); @@ -37,11 +32,6 @@ public function append(PatternParser $parser) : self return $this; } - /** - * @param string $literal - * - * @return self - */ public function appendLiteral(string $literal) : self { $this->pattern .= \preg_quote($literal, '/'); @@ -49,12 +39,6 @@ public function appendLiteral(string $literal) : self return $this; } - /** - * @param string $pattern - * @param string $field - * - * @return self - */ public function appendCapturePattern(string $pattern, string $field) : self { $this->pattern .= '(' . $pattern . ')'; @@ -63,9 +47,6 @@ public function appendCapturePattern(string $pattern, string $field) : self return $this; } - /** - * @return self - */ public function startOptional() : self { $this->pattern .= '(?:'; @@ -74,9 +55,6 @@ public function startOptional() : self return $this; } - /** - * @return self - */ public function endOptional() : self { if (\array_pop($this->stack) !== 'O') { @@ -88,9 +66,6 @@ public function endOptional() : self return $this; } - /** - * @return self - */ public function startGroup() : self { $this->pattern .= '(?:'; @@ -99,9 +74,6 @@ public function startGroup() : self return $this; } - /** - * @return self - */ public function endGroup() : self { if (\array_pop($this->stack) !== 'G') { @@ -113,9 +85,6 @@ public function endGroup() : self return $this; } - /** - * @return self - */ public function appendOr() : self { $this->pattern .= '|'; @@ -123,9 +92,6 @@ public function appendOr() : self return $this; } - /** - * @return PatternParser - */ public function toParser() : PatternParser { if ($this->stack) { diff --git a/src/Period.php b/src/Period.php index d2c6524..4ac9a12 100644 --- a/src/Period.php +++ b/src/Period.php @@ -46,49 +46,27 @@ private function __construct(int $years, int $months, int $days) * @param int $years The number of years. * @param int $months The number of months. * @param int $days The number of days. - * - * @return Period */ public static function of(int $years, int $months, int $days) : Period { return new Period($years, $months, $days); } - /** - * @param int $years - * - * @return Period - */ public static function ofYears(int $years) : Period { return new Period($years, 0, 0); } - /** - * @param int $months - * - * @return Period - */ public static function ofMonths(int $months) : Period { return new Period(0, $months, 0); } - /** - * @param int $weeks - * - * @return Period - */ public static function ofWeeks(int $weeks) : Period { return new Period(0, 0, $weeks * LocalTime::DAYS_PER_WEEK); } - /** - * @param int $days - * - * @return Period - */ public static function ofDays(int $days) : Period { return new Period(0, 0, $days); @@ -96,8 +74,6 @@ public static function ofDays(int $days) : Period /** * Creates a zero Period. - * - * @return Period */ public static function zero() : Period { @@ -118,11 +94,7 @@ public static function zero() : Period * Each of the (years, months, weeks, days) values can optionally be preceded with a '+' or '-' sign. * The whole string can also start with an optional '+' or '-' sign, which will further affect all the fields. * - * @param string $text - * - * @return \Brick\DateTime\Period - * - * @throws \Brick\DateTime\Parser\DateTimeParseException + * @throws Parser\DateTimeParseException */ public static function parse(string $text) : Period { @@ -175,46 +147,27 @@ public static function parse(string $text) : Period * * The result of this method can be a negative period if the end is before the start. * The negative sign will be the same in each of year, month and day. - * - * @param LocalDate $startInclusive - * @param LocalDate $endExclusive - * - * @return Period */ public static function between(LocalDate $startInclusive, LocalDate $endExclusive) : Period { return $startInclusive->until($endExclusive); } - /** - * @return int - */ public function getYears() : int { return $this->years; } - /** - * @return int - */ public function getMonths() : int { return $this->months; } - /** - * @return int - */ public function getDays() : int { return $this->days; } - /** - * @param int $years - * - * @return Period - */ public function withYears(int $years) : Period { if ($years === $this->years) { @@ -224,11 +177,6 @@ public function withYears(int $years) : Period return new Period($years, $this->months, $this->days); } - /** - * @param int $months - * - * @return Period - */ public function withMonths(int $months) : Period { if ($months === $this->months) { @@ -238,11 +186,6 @@ public function withMonths(int $months) : Period return new Period($this->years, $months, $this->days); } - /** - * @param int $days - * - * @return Period - */ public function withDays(int $days) : Period { if ($days === $this->days) { @@ -252,11 +195,6 @@ public function withDays(int $days) : Period return new Period($this->years, $this->months, $days); } - /** - * @param int $years - * - * @return Period - */ public function plusYears(int $years) : Period { if ($years === 0) { @@ -266,11 +204,6 @@ public function plusYears(int $years) : Period return new Period($this->years + $years, $this->months, $this->days); } - /** - * @param int $months - * - * @return Period - */ public function plusMonths(int $months) : Period { if ($months === 0) { @@ -280,11 +213,6 @@ public function plusMonths(int $months) : Period return new Period($this->years, $this->months + $months, $this->days); } - /** - * @param int $days - * - * @return Period - */ public function plusDays(int $days) : Period { if ($days === 0) { @@ -294,11 +222,6 @@ public function plusDays(int $days) : Period return new Period($this->years, $this->months, $this->days + $days); } - /** - * @param int $years - * - * @return Period - */ public function minusYears(int $years) : Period { if ($years === 0) { @@ -308,11 +231,6 @@ public function minusYears(int $years) : Period return new Period($this->years - $years, $this->months, $this->days); } - /** - * @param int $months - * - * @return Period - */ public function minusMonths(int $months) : Period { if ($months === 0) { @@ -322,11 +240,6 @@ public function minusMonths(int $months) : Period return new Period($this->years, $this->months - $months, $this->days); } - /** - * @param int $days - * - * @return Period - */ public function minusDays(int $days) : Period { if ($days === 0) { @@ -338,10 +251,6 @@ public function minusDays(int $days) : Period /** * Returns a new Period with each value multiplied by the given scalar. - * - * @param int $scalar - * - * @return Period */ public function multipliedBy(int $scalar) : Period { @@ -358,8 +267,6 @@ public function multipliedBy(int $scalar) : Period /** * Returns a new instance with each amount in this Period negated. - * - * @return Period */ public function negated() : Period { @@ -385,8 +292,6 @@ public function negated() : Period * The sign of the years and months units will be the same after normalization. * For example, a period of "1 year and -25 months" will be normalized to * "-1 year and -1 month". - * - * @return Period */ public function normalized() : Period { @@ -402,19 +307,11 @@ public function normalized() : Period return new Period($splitYears, $splitMonths, $this->days); } - /** - * @return bool - */ public function isZero() : bool { return $this->years === 0 && $this->months === 0 && $this->days === 0; } - /** - * @param Period $that - * - * @return bool - */ public function isEqualTo(Period $that) : bool { return $this->years === $that->years @@ -427,8 +324,6 @@ public function isEqualTo(Period $that) : bool * * We cannot use the constructor with the output of __toString(), * as it does not support negative values. - * - * @return \DateInterval */ public function toDateInterval() : \DateInterval { @@ -442,17 +337,12 @@ public function toDateInterval() : \DateInterval /** * Serializes as a string using {@see Period::__toString()}. - * - * @return string */ public function jsonSerialize() : string { return (string) $this; } - /** - * @return string - */ public function __toString() : string { if ($this->isZero()) { diff --git a/src/Stopwatch.php b/src/Stopwatch.php index dc9987c..caba8fa 100644 --- a/src/Stopwatch.php +++ b/src/Stopwatch.php @@ -31,8 +31,6 @@ final class Stopwatch private $startTime; /** - * Class constructor. - * * @param Clock|null $clock An optional clock to use. */ public function __construct(?Clock $clock = null) @@ -49,8 +47,6 @@ public function __construct(?Clock $clock = null) * Starts the timer. * * If the timer is already started, this method does nothing. - * - * @return void */ public function start() : void { @@ -63,8 +59,6 @@ public function start() : void * Stops the timer. * * If the timer is already stopped, this method does nothing. - * - * @return void */ public function stop() : void { @@ -81,17 +75,12 @@ public function stop() : void /** * Returns the time this stopwatch has been started at, or null if it is not running. - * - * @return Instant|null */ public function getStartTime() : ?Instant { return $this->startTime; } - /** - * @return bool - */ public function isRunning() : bool { return $this->startTime !== null; @@ -102,8 +91,6 @@ public function isRunning() : bool * * This includes the times between previous start() and stop() calls if any, * as well as the time since the stopwatch was last started if it is running. - * - * @return Duration */ public function getElapsedTime() : Duration { diff --git a/src/TimeZone.php b/src/TimeZone.php index 6a1fd91..eea0c0f 100644 --- a/src/TimeZone.php +++ b/src/TimeZone.php @@ -17,11 +17,7 @@ abstract class TimeZone /** * Obtains an instance of `TimeZone` from a string representation. * - * @param string $text - * - * @return TimeZone - * - * @throws \Brick\DateTime\Parser\DateTimeParseException + * @throws DateTimeParseException */ public static function parse(string $text) : TimeZone { @@ -40,9 +36,6 @@ public static function parse(string $text) : TimeZone return TimeZoneRegion::parse($text); } - /** - * @return TimeZoneOffset - */ public static function utc() : TimeZoneOffset { return TimeZoneOffset::utc(); @@ -50,8 +43,6 @@ public static function utc() : TimeZoneOffset /** * Returns the unique time-zone ID. - * - * @return string */ abstract public function getId() : string; @@ -64,29 +55,16 @@ abstract public function getId() : string; */ abstract public function getOffset(Instant $pointInTime) : int; - /** - * @param TimeZone $other - * - * @return bool - */ public function isEqualTo(TimeZone $other) : bool { return $this->getId() === $other->getId(); } - /** - * @return string - */ public function __toString() : string { return $this->getId(); } - /** - * @param \DateTimeZone $dateTimeZone - * - * @return TimeZone - */ public static function fromDateTimeZone(\DateTimeZone $dateTimeZone) : TimeZone { return TimeZone::parse($dateTimeZone->getName()); @@ -94,8 +72,6 @@ public static function fromDateTimeZone(\DateTimeZone $dateTimeZone) : TimeZone /** * Returns an equivalent native `DateTimeZone` object for this TimeZone. - * - * @return \DateTimeZone The native DateTimeZone object. */ abstract public function toDateTimeZone() : \DateTimeZone; } diff --git a/src/TimeZoneOffset.php b/src/TimeZoneOffset.php index d18331e..79d954e 100644 --- a/src/TimeZoneOffset.php +++ b/src/TimeZoneOffset.php @@ -47,8 +47,6 @@ private function __construct(int $totalSeconds) * @param int $minutes The time-zone offset in minutes, from 0 to 59, sign matching hours. * @param int $seconds The time-zone offset in seconds, from 0 to 59, sign matching hours and minute. * - * @return TimeZoneOffset - * * @throws DateTimeException If the values are not in range or the signs don't match. */ public static function of(int $hours, int $minutes = 0, int $seconds = 0) : TimeZoneOffset @@ -82,8 +80,6 @@ public static function of(int $hours, int $minutes = 0, int $seconds = 0) : Time * * @param int $totalSeconds The total offset in seconds. * - * @return TimeZoneOffset - * * @throws DateTimeException */ public static function ofTotalSeconds(int $totalSeconds) : TimeZoneOffset @@ -93,19 +89,12 @@ public static function ofTotalSeconds(int $totalSeconds) : TimeZoneOffset return new TimeZoneOffset($totalSeconds); } - /** - * @return TimeZoneOffset - */ public static function utc() : TimeZoneOffset { return new TimeZoneOffset(0); } /** - * @param DateTimeParseResult $result - * - * @return TimeZoneOffset - * * @throws DateTimeException If the offset is not valid. * @throws DateTimeParseException If required fields are missing from the result. */ @@ -145,11 +134,6 @@ public static function from(DateTimeParseResult $result) : TimeZoneOffset * * Note that ± means either the plus or minus symbol. * - * @param string $text - * @param DateTimeParser|null $parser - * - * @return TimeZone - * * @throws DateTimeParseException */ public static function parse(string $text, ?DateTimeParser $parser = null) : TimeZone @@ -175,9 +159,6 @@ public function getTotalSeconds() : int return $this->totalSeconds; } - /** - * {@inheritdoc} - */ public function getId() : string { if ($this->id === null) { @@ -193,17 +174,11 @@ public function getId() : string return $this->id; } - /** - * {@inheritdoc} - */ public function getOffset(Instant $pointInTime) : int { return $this->totalSeconds; } - /** - * {@inheritdoc} - */ public function toDateTimeZone() : \DateTimeZone { return new \DateTimeZone($this->getId()); diff --git a/src/TimeZoneRegion.php b/src/TimeZoneRegion.php index f091dfe..2c383c8 100644 --- a/src/TimeZoneRegion.php +++ b/src/TimeZoneRegion.php @@ -32,8 +32,6 @@ private function __construct(\DateTimeZone $zone) /** * @param string $id The region id. * - * @return TimeZoneRegion - * * @throws DateTimeException If the region id is invalid. */ public static function of(string $id) : TimeZoneRegion @@ -51,10 +49,6 @@ public static function of(string $id) : TimeZoneRegion } /** - * @param DateTimeParseResult $result - * - * @return TimeZoneRegion - * * @throws DateTimeException If the region is not valid. * @throws DateTimeParseException If required fields are missing from the result. */ @@ -106,11 +100,6 @@ public static function getIdentifiersForCountry(string $countryCode) : array /** * Parses a region id, such as 'Europe/London'. * - * @param string $text - * @param DateTimeParser|null $parser - * - * @return TimeZone - * * @throws DateTimeParseException */ public static function parse(string $text, ?DateTimeParser $parser = null) : TimeZone @@ -122,17 +111,11 @@ public static function parse(string $text, ?DateTimeParser $parser = null) : Tim return TimeZoneRegion::from($parser->parse($text)); } - /** - * {@inheritdoc} - */ public function getId() : string { return $this->zone->getName(); } - /** - * {@inheritdoc} - */ public function getOffset(Instant $instant) : int { $dateTime = new \DateTime('@' . $instant->getEpochSecond(), new \DateTimeZone('UTC')); @@ -140,9 +123,6 @@ public function getOffset(Instant $instant) : int return $this->zone->getOffset($dateTime); } - /** - * {@inheritdoc} - */ public function toDateTimeZone() : \DateTimeZone { return clone $this->zone; diff --git a/src/Utility/Math.php b/src/Utility/Math.php index fcf0531..419e767 100644 --- a/src/Utility/Math.php +++ b/src/Utility/Math.php @@ -14,11 +14,6 @@ final class Math { /** - * @param int $a - * @param int $b - * - * @return int - * * @throws ArithmeticError */ public static function addExact(int $a, int $b) : int @@ -33,11 +28,6 @@ public static function addExact(int $a, int $b) : int } /** - * @param int $a - * @param int $b - * - * @return int - * * @throws ArithmeticError */ public static function multiplyExact(int $a, int $b) : int @@ -56,8 +46,6 @@ public static function multiplyExact(int $a, int $b) : int * * @param int $a The first argument. * @param int $b The second argument, non-zero. - * - * @return int */ public static function floorDiv(int $a, int $b) : int { @@ -79,8 +67,6 @@ public static function floorDiv(int $a, int $b) : int * * @param int $a The first argument. * @param int $b The second argument, non-zero. - * - * @return int */ public static function floorMod(int $a, int $b) : int { diff --git a/src/Year.php b/src/Year.php index 04251bb..4006151 100644 --- a/src/Year.php +++ b/src/Year.php @@ -22,8 +22,6 @@ final class Year implements \JsonSerializable private $year; /** - * Class constructor. - * * @param int $year The year to represent, validated. */ private function __construct(int $year) @@ -32,10 +30,6 @@ private function __construct(int $year) } /** - * @param int $year - * - * @return Year - * * @throws DateTimeException If the year is out of range. */ public static function of(int $year) : Year @@ -49,20 +43,12 @@ public static function of(int $year) : Year * Returns the current year in the given time-zone, according to the given clock. * * If no clock is provided, the system clock is used. - * - * @param TimeZone $timeZone - * @param Clock|null $clock - * - * @return Year */ public static function now(TimeZone $timeZone, ?Clock $clock = null) : Year { return new Year(LocalDate::now($timeZone, $clock)->getYear()); } - /** - * @return int - */ public function getValue() : int { return $this->year; @@ -78,19 +64,12 @@ public function getValue() : int * * The calculation is proleptic - applying the same rules into the far future and far past. * This is historically inaccurate, but is correct for the ISO-8601 standard. - * - * @return bool */ public function isLeap() : bool { return Field\Year::isLeap($this->year); } - /** - * @param MonthDay $monthDay - * - * @return bool - */ public function isValidMonthDay(MonthDay $monthDay) : bool { return $monthDay->isValidYear($this->year); @@ -245,8 +224,6 @@ public function atMonth(int $month) : YearMonth * in the resulting date if the year is not a leap year. * * @param MonthDay $monthDay The month-day to use. - * - * @return LocalDate */ public function atMonthDay(MonthDay $monthDay) : LocalDate { @@ -255,17 +232,12 @@ public function atMonthDay(MonthDay $monthDay) : LocalDate /** * Serializes as a string using {@see Year::__toString()}. - * - * @return string */ public function jsonSerialize() : string { return (string) $this; } - /** - * @return string - */ public function __toString() : string { return (string) $this->year; diff --git a/src/YearMonth.php b/src/YearMonth.php index 1ada2e7..9583a30 100644 --- a/src/YearMonth.php +++ b/src/YearMonth.php @@ -30,8 +30,6 @@ final class YearMonth implements \JsonSerializable private $month; /** - * Class constructor. - * * @param int $year The year, validated from MIN_YEAR to MAX_YEAR. * @param int $month The month, validated in the range 1 to 12. */ @@ -47,8 +45,6 @@ private function __construct(int $year, int $month) * @param int $year The year, from MIN_YEAR to MAX_YEAR. * @param int $month The month-of-year, from 1 (January) to 12 (December). * - * @return YearMonth - * * @throws DateTimeException */ public static function of(int $year, int $month) : YearMonth @@ -60,10 +56,6 @@ public static function of(int $year, int $month) : YearMonth } /** - * @param DateTimeParseResult $result - * - * @return YearMonth - * * @throws DateTimeException If the year-month is not valid. * @throws DateTimeParseException If required fields are missing from the result. */ @@ -81,8 +73,6 @@ public static function from(DateTimeParseResult $result) : YearMonth * @param string $text The text to parse, such as `2007-12`. * @param DateTimeParser|null $parser The parser to use, defaults to the ISO 8601 parser. * - * @return YearMonth - * * @throws DateTimeException If the date is not valid. * @throws DateTimeParseException If the text string does not follow the expected format. */ @@ -112,17 +102,11 @@ public static function now(TimeZone $timeZone, ?Clock $clock = null) : YearMonth return new YearMonth($localDate->getYear(), $localDate->getMonth()); } - /** - * @return int - */ public function getYear() : int { return $this->year; } - /** - * @return int - */ public function getMonth() : int { return $this->month; @@ -130,8 +114,6 @@ public function getMonth() : int /** * Returns whether the year is a leap year. - * - * @return bool */ public function isLeapYear() : bool { @@ -140,8 +122,6 @@ public function isLeapYear() : bool /** * Returns the length of the month in days, taking account of the year. - * - * @return int */ public function getLengthOfMonth() : int { @@ -150,8 +130,6 @@ public function getLengthOfMonth() : int /** * Returns the length of the year in days, either 365 or 366. - * - * @return int */ public function getLengthOfYear() : int { @@ -159,8 +137,6 @@ public function getLengthOfYear() : int } /** - * @param YearMonth $that - * * @return int [-1,0,1] If this year-month is before, on, or after the given year-month. */ public function compareTo(YearMonth $that) : int @@ -181,51 +157,26 @@ public function compareTo(YearMonth $that) : int return 0; } - /** - * @param YearMonth $that - * - * @return bool - */ public function isEqualTo(YearMonth $that) : bool { return $this->compareTo($that) === 0; } - /** - * @param YearMonth $that - * - * @return bool - */ public function isBefore(YearMonth $that) : bool { return $this->compareTo($that) === -1; } - /** - * @param YearMonth $that - * - * @return bool - */ public function isBeforeOrEqualTo(YearMonth $that) : bool { return $this->compareTo($that) <= 0; } - /** - * @param YearMonth $that - * - * @return bool - */ public function isAfter(YearMonth $that) : bool { return $this->compareTo($that) === 1; } - /** - * @param YearMonth $that - * - * @return bool - */ public function isAfterOrEqualTo(YearMonth $that) : bool { return $this->compareTo($that) >= 0; @@ -234,10 +185,6 @@ public function isAfterOrEqualTo(YearMonth $that) : bool /** * Returns a copy of this YearMonth with the year altered. * - * @param int $year - * - * @return YearMonth - * * @throws DateTimeException If the year is not valid. */ public function withYear(int $year) : YearMonth @@ -254,10 +201,6 @@ public function withYear(int $year) : YearMonth /** * Returns a copy of this YearMonth with the month-of-year altered. * - * @param int $month - * - * @return YearMonth - * * @throws DateTimeException If the month-of-year is not valid. */ public function withMonth(int $month) : YearMonth @@ -271,17 +214,11 @@ public function withMonth(int $month) : YearMonth return new YearMonth($this->year, $month); } - /** - * @return LocalDate - */ public function getFirstDay() : LocalDate { return $this->atDay(1); } - /** - * @return LocalDate - */ public function getLastDay() : LocalDate { return $this->atDay($this->getLengthOfMonth()); @@ -303,10 +240,6 @@ public function atDay(int $day) : LocalDate /** * Returns a copy of this YearMonth with the specified period in years added. - * - * @param int $years - * - * @return YearMonth */ public function plusYears(int $years) : YearMonth { @@ -319,10 +252,6 @@ public function plusYears(int $years) : YearMonth /** * Returns a copy of this YearMonth with the specified period in months added. - * - * @param int $months - * - * @return YearMonth */ public function plusMonths(int $months) : YearMonth { @@ -342,10 +271,6 @@ public function plusMonths(int $months) : YearMonth /** * Returns a copy of this YearMonth with the specified period in years subtracted. - * - * @param int $years - * - * @return YearMonth */ public function minusYears(int $years) : YearMonth { @@ -354,10 +279,6 @@ public function minusYears(int $years) : YearMonth /** * Returns a copy of this YearMonth with the specified period in months subtracted. - * - * @param int $months - * - * @return YearMonth */ public function minusMonths(int $months) : YearMonth { @@ -366,8 +287,6 @@ public function minusMonths(int $months) : YearMonth /** * Serializes as a string using {@see YearMonth::__toString()}. - * - * @return string */ public function jsonSerialize() : string { @@ -376,8 +295,6 @@ public function jsonSerialize() : string /** * Returns the ISO 8601 representation of this YearMonth. - * - * @return string */ public function __toString() : string { diff --git a/src/YearMonthRange.php b/src/YearMonthRange.php index ea61525..8f2d986 100644 --- a/src/YearMonthRange.php +++ b/src/YearMonthRange.php @@ -20,20 +20,18 @@ class YearMonthRange implements \IteratorAggregate, \Countable, \JsonSerializabl /** * The start year-month, inclusive. * - * @var \Brick\DateTime\YearMonth + * @var YearMonth */ private $start; /** * The end year-month, inclusive. * - * @var \Brick\DateTime\YearMonth + * @var YearMonth */ private $end; /** - * Class constructor. - * * @param YearMonth $start The start year-month, inclusive. * @param YearMonth $end The end year-month, inclusive, validated as not before the start year-month. */ @@ -49,8 +47,6 @@ private function __construct(YearMonth $start, YearMonth $end) * @param YearMonth $start The start year-month, inclusive. * @param YearMonth $end The end year-month, inclusive. * - * @return YearMonthRange - * * @throws DateTimeException If the end year-month is before the start year-month. */ public static function of(YearMonth $start, YearMonth $end) : YearMonthRange @@ -67,10 +63,6 @@ public static function of(YearMonth $start, YearMonth $end) : YearMonthRange * * This method is only useful to parsers. * - * @param DateTimeParseResult $result - * - * @return YearMonthRange - * * @throws DateTimeException If the year-month range is not valid. * @throws DateTimeParseException If required fields are missing from the result. */ @@ -98,8 +90,6 @@ public static function from(DateTimeParseResult $result) : YearMonthRange * @param string $text The text to parse. * @param DateTimeParser|null $parser The parser to use, defaults to the ISO 8601 parser. * - * @return YearMonthRange - * * @throws DateTimeException If either of the year-months is not valid. * @throws DateTimeParseException If the text string does not follow the expected format. */ @@ -114,8 +104,6 @@ public static function parse(string $text, ?DateTimeParser $parser = null) : Yea /** * Returns the start year-month, inclusive. - * - * @return YearMonth */ public function getStart() : YearMonth { @@ -124,8 +112,6 @@ public function getStart() : YearMonth /** * Returns the end year-month, inclusive. - * - * @return YearMonth */ public function getEnd() : YearMonth { @@ -182,8 +168,6 @@ public function count() : int /** * Serializes as a string using {@see YearMonthRange::__toString()}. - * - * @return string */ public function jsonSerialize() : string { @@ -195,8 +179,6 @@ public function jsonSerialize() : string * * ISO 8601 does not seem to provide a standard notation for year-month ranges, but we're using the same format as * date ranges. - * - * @return string */ public function __toString() : string { diff --git a/src/YearWeek.php b/src/YearWeek.php index d525a18..f72b47d 100644 --- a/src/YearWeek.php +++ b/src/YearWeek.php @@ -24,8 +24,6 @@ final class YearWeek implements \JsonSerializable private $week; /** - * Class constructor. - * * @param int $year The year, validated from MIN_YEAR to MAX_YEAR. * @param int $week The week number, validated in the range 1 to 53, and valid for the year. */ @@ -41,8 +39,6 @@ private function __construct(int $year, int $week) * @param int $year The year, from MIN_YEAR to MAX_YEAR. * @param int $week The week number, from 1 to 53. * - * @return YearWeek - * * @throws DateTimeException */ public static function of(int $year, int $week) : YearWeek @@ -53,36 +49,22 @@ public static function of(int $year, int $week) : YearWeek return new YearWeek($year, $week); } - /** - * @param TimeZone $timeZone - * @param Clock|null $clock - * - * @return YearWeek - */ public static function now(TimeZone $timeZone, ?Clock $clock = null) : YearWeek { return LocalDate::now($timeZone, $clock)->getYearWeek(); } - /** - * @return int - */ public function getYear() : int { return $this->year; } - /** - * @return int - */ public function getWeek() : int { return $this->week; } /** - * @param YearWeek $that - * * @return int [-1,0,1] If this year-week is before, on, or after the given year-week. */ public function compareTo(YearWeek $that) : int @@ -103,51 +85,26 @@ public function compareTo(YearWeek $that) : int return 0; } - /** - * @param YearWeek $that - * - * @return bool - */ public function isEqualTo(YearWeek $that) : bool { return $this->compareTo($that) === 0; } - /** - * @param YearWeek $that - * - * @return bool - */ public function isBefore(YearWeek $that) : bool { return $this->compareTo($that) === -1; } - /** - * @param YearWeek $that - * - * @return bool - */ public function isBeforeOrEqualTo(YearWeek $that) : bool { return $this->compareTo($that) <= 0; } - /** - * @param YearWeek $that - * - * @return bool - */ public function isAfter(YearWeek $that) : bool { return $this->compareTo($that) === 1; } - /** - * @param YearWeek $that - * - * @return bool - */ public function isAfterOrEqualTo(YearWeek $that) : bool { return $this->compareTo($that) >= 0; @@ -158,10 +115,6 @@ public function isAfterOrEqualTo(YearWeek $that) : bool * * If the week is 53 and the new year does not have 53 weeks, the week will be adjusted to be 52. * - * @param int $year - * - * @return YearWeek - * * @throws DateTimeException If the year is not valid. */ public function withYear(int $year) : YearWeek @@ -186,10 +139,6 @@ public function withYear(int $year) : YearWeek * * If the new week is 53 and the year does not have 53 weeks, week one of the following year is selected. * - * @param int $week - * - * @return YearWeek - * * @throws DateTimeException If the week is not valid. */ public function withWeek(int $week) : YearWeek @@ -212,10 +161,6 @@ public function withWeek(int $week) : YearWeek /** * Combines this year-week with a day-of-week to create a LocalDate. - * - * @param int $dayOfWeek - * - * @return LocalDate */ public function atDay(int $dayOfWeek) : LocalDate { @@ -240,8 +185,6 @@ public function atDay(int $dayOfWeek) : LocalDate /** * Returns the first day of this week. - * - * @return LocalDate */ public function getFirstDay() : LocalDate { @@ -250,8 +193,6 @@ public function getFirstDay() : LocalDate /** * Returns the last day of this week. - * - * @return LocalDate */ public function getLastDay() : LocalDate { @@ -262,10 +203,6 @@ public function getLastDay() : LocalDate * Returns a copy of this YearWeek with the specified period in years added. * * If the week is 53 and the new year does not have 53 weeks, the week will be adjusted to be 52. - * - * @param int $years - * - * @return YearWeek */ public function plusYears(int $years) : YearWeek { @@ -278,10 +215,6 @@ public function plusYears(int $years) : YearWeek /** * Returns a copy of this YearWeek with the specified period in weeks added. - * - * @param int $weeks - * - * @return YearWeek */ public function plusWeeks(int $weeks) : YearWeek { @@ -298,10 +231,6 @@ public function plusWeeks(int $weeks) : YearWeek * Returns a copy of this YearWeek with the specified period in years subtracted. * * If the week is 53 and the new year does not have 53 weeks, the week will be adjusted to be 52. - * - * @param int $years - * - * @return YearWeek */ public function minusYears(int $years) : YearWeek { @@ -310,10 +239,6 @@ public function minusYears(int $years) : YearWeek /** * Returns a copy of this YearWeek with the specified period in weeks subtracted. - * - * @param int $weeks - * - * @return YearWeek */ public function minusWeeks(int $weeks) : YearWeek { @@ -322,8 +247,6 @@ public function minusWeeks(int $weeks) : YearWeek /** * Returns whether this year has 53 weeks. - * - * @return bool */ public function is53WeekYear() : bool { @@ -332,17 +255,12 @@ public function is53WeekYear() : bool /** * Serializes as a string using {@see YearWeek::__toString()}. - * - * @return string */ public function jsonSerialize() : string { return (string) $this; } - /** - * @return string - */ public function __toString() : string { $pattern = ($this->year < 0 ? '%05d' : '%04d') . '-W%02d'; diff --git a/src/ZonedDateTime.php b/src/ZonedDateTime.php index cd18322..9eb66d3 100644 --- a/src/ZonedDateTime.php +++ b/src/ZonedDateTime.php @@ -89,11 +89,6 @@ private function __construct(LocalDateTime $localDateTime, TimeZoneOffset $offse * - If the local date-time falls in the middle of a gap, then the resulting date-time will be shifted forward * by the length of the gap, and the later offset, typically "summer" time, will be used. * - If the local date-time falls in the middle of an overlap, then the offset closest to UTC will be used. - * - * @param LocalDateTime $dateTime - * @param TimeZone timeZone - * - * @return ZonedDateTime */ public static function of(LocalDateTime $dateTime, TimeZone $timeZone) : ZonedDateTime { @@ -120,11 +115,6 @@ public static function of(LocalDateTime $dateTime, TimeZone $timeZone) : ZonedDa * Creates a ZonedDateTime from an instant and a time zone. * * This resolves the instant to a date and time without ambiguity. - * - * @param Instant $instant The instant. - * @param TimeZone $timeZone The time zone. - * - * @return ZonedDateTime */ public static function ofInstant(Instant $instant, TimeZone $timeZone) : ZonedDateTime { @@ -152,11 +142,6 @@ public static function ofInstant(Instant $instant, TimeZone $timeZone) : ZonedDa * Returns the current date-time in the given time-zone, according to the given clock. * * If no clock is provided, the system clock is used. - * - * @param TimeZone $timeZone - * @param Clock|null $clock - * - * @return ZonedDateTime */ public static function now(TimeZone $timeZone, ?Clock $clock = null) : ZonedDateTime { @@ -168,10 +153,6 @@ public static function now(TimeZone $timeZone, ?Clock $clock = null) : ZonedDate * * This method is only useful to parsers. * - * @param DateTimeParseResult $result - * - * @return ZonedDateTime - * * @throws DateTimeException If the zoned date-time is not valid. * @throws DateTimeParseException If required fields are missing from the result. */ @@ -204,8 +185,6 @@ public static function from(DateTimeParseResult $result) : ZonedDateTime * @param string $text The text to parse. * @param DateTimeParser|null $parser The parser to use, defaults to the ISO 8601 parser. * - * @return ZonedDateTime - * * @throws DateTimeException If the date is not valid. * @throws DateTimeParseException If the text string does not follow the expected format. */ @@ -221,10 +200,6 @@ public static function parse(string $text, ?DateTimeParser $parser = null) : Zon /** * Creates a ZonedDateTime from a native DateTime or DateTimeImmutable object. * - * @param \DateTimeInterface $dateTime - * - * @return ZonedDateTime - * * @throws DateTimeException If the DateTime object has no timezone. */ public static function fromDateTime(\DateTimeInterface $dateTime) : ZonedDateTime @@ -252,8 +227,6 @@ public static function fromDateTime(\DateTimeInterface $dateTime) : ZonedDateTim /** * Returns the `LocalDateTime` part of this `ZonedDateTime`. - * - * @return LocalDateTime */ public function getDateTime() : LocalDateTime { @@ -262,8 +235,6 @@ public function getDateTime() : LocalDateTime /** * Returns the `LocalDate` part of this `ZonedDateTime`. - * - * @return LocalDate */ public function getDate() : LocalDate { @@ -272,89 +243,57 @@ public function getDate() : LocalDate /** * Returns the `LocalTime` part of this `ZonedDateTime`. - * - * @return LocalTime */ public function getTime() : LocalTime { return $this->localDateTime->getTime(); } - /** - * @return int - */ public function getYear() : int { return $this->localDateTime->getYear(); } - /** - * @return int - */ public function getMonth() : int { return $this->localDateTime->getMonth(); } - /** - * @return int - */ public function getDay() : int { return $this->localDateTime->getDay(); } - /** - * @return DayOfWeek - */ public function getDayOfWeek() : DayOfWeek { return $this->localDateTime->getDayOfWeek(); } - /** - * @return int - */ public function getDayOfYear() : int { return $this->localDateTime->getDayOfYear(); } - /** - * @return int - */ public function getHour() : int { return $this->localDateTime->getHour(); } - /** - * @return int - */ public function getMinute() : int { return $this->localDateTime->getMinute(); } - /** - * @return int - */ public function getSecond() : int { return $this->localDateTime->getSecond(); } - /** - * @return int - */ public function getEpochSecond() : int { return $this->instant->getEpochSecond(); } - /** - * @return int - */ public function getNano() : int { return $this->instant->getNano(); @@ -362,8 +301,6 @@ public function getNano() : int /** * Returns the time-zone, region or offset. - * - * @return TimeZone */ public function getTimeZone() : TimeZone { @@ -372,17 +309,12 @@ public function getTimeZone() : TimeZone /** * Returns the time-zone offset. - * - * @return TimeZoneOffset */ public function getTimeZoneOffset() : TimeZoneOffset { return $this->timeZoneOffset; } - /** - * {@inheritdoc} - */ public function getInstant() : Instant { return $this->instant; @@ -390,10 +322,6 @@ public function getInstant() : Instant /** * Returns a copy of this ZonedDateTime with a different date. - * - * @param LocalDate $date - * - * @return ZonedDateTime */ public function withDate(LocalDate $date) : ZonedDateTime { @@ -402,10 +330,6 @@ public function withDate(LocalDate $date) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with a different time. - * - * @param LocalTime $time - * - * @return ZonedDateTime */ public function withTime(LocalTime $time) : ZonedDateTime { @@ -414,10 +338,6 @@ public function withTime(LocalTime $time) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the year altered. - * - * @param int $year - * - * @return ZonedDateTime */ public function withYear(int $year) : ZonedDateTime { @@ -426,10 +346,6 @@ public function withYear(int $year) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the month-of-year altered. - * - * @param int $month - * - * @return ZonedDateTime */ public function withMonth(int $month) : ZonedDateTime { @@ -438,10 +354,6 @@ public function withMonth(int $month) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the day-of-month altered. - * - * @param int $day - * - * @return ZonedDateTime */ public function withDay(int $day) : ZonedDateTime { @@ -450,10 +362,6 @@ public function withDay(int $day) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the hour-of-day altered. - * - * @param int $hour - * - * @return ZonedDateTime */ public function withHour(int $hour) : ZonedDateTime { @@ -462,10 +370,6 @@ public function withHour(int $hour) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the minute-of-hour altered. - * - * @param int $minute - * - * @return ZonedDateTime */ public function withMinute(int $minute) : ZonedDateTime { @@ -474,10 +378,6 @@ public function withMinute(int $minute) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the second-of-minute altered. - * - * @param int $second - * - * @return ZonedDateTime */ public function withSecond(int $second) : ZonedDateTime { @@ -486,10 +386,6 @@ public function withSecond(int $second) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the nano-of-second altered. - * - * @param int $nano - * - * @return ZonedDateTime */ public function withNano(int $nano) : ZonedDateTime { @@ -499,10 +395,6 @@ public function withNano(int $nano) : ZonedDateTime /** * Returns a copy of this `ZonedDateTime` with a different time-zone, * retaining the local date-time if possible. - * - * @param TimeZone $timeZone The time-zone to change to. - * - * @return ZonedDateTime */ public function withTimeZoneSameLocal(TimeZone $timeZone) : ZonedDateTime { @@ -511,10 +403,6 @@ public function withTimeZoneSameLocal(TimeZone $timeZone) : ZonedDateTime /** * Returns a copy of this date-time with a different time-zone, retaining the instant. - * - * @param TimeZone $timeZone - * - * @return ZonedDateTime */ public function withTimeZoneSameInstant(TimeZone $timeZone) : ZonedDateTime { @@ -532,8 +420,6 @@ public function withTimeZoneSameInstant(TimeZone $timeZone) : ZonedDateTime * due to time-zone rules. * This might also be useful when sending a zoned date-time across a network, * as most protocols, such as ISO-8601, only handle offsets, and not region-based time zones. - * - * @return ZonedDateTime */ public function withFixedOffsetTimeZone() : ZonedDateTime { @@ -542,10 +428,6 @@ public function withFixedOffsetTimeZone() : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified Period added. - * - * @param Period $period - * - * @return ZonedDateTime */ public function plusPeriod(Period $period) : ZonedDateTime { @@ -554,10 +436,6 @@ public function plusPeriod(Period $period) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified Duration added. - * - * @param Duration $duration - * - * @return ZonedDateTime */ public function plusDuration(Duration $duration) : ZonedDateTime { @@ -566,10 +444,6 @@ public function plusDuration(Duration $duration) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified period in years added. - * - * @param int $years - * - * @return ZonedDateTime */ public function plusYears(int $years) : ZonedDateTime { @@ -578,10 +452,6 @@ public function plusYears(int $years) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified period in months added. - * - * @param int $months - * - * @return ZonedDateTime */ public function plusMonths(int $months) : ZonedDateTime { @@ -590,10 +460,6 @@ public function plusMonths(int $months) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified period in weeks added. - * - * @param int $weeks - * - * @return ZonedDateTime */ public function plusWeeks(int $weeks) : ZonedDateTime { @@ -602,10 +468,6 @@ public function plusWeeks(int $weeks) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified period in days added. - * - * @param int $days - * - * @return ZonedDateTime */ public function plusDays(int $days) : ZonedDateTime { @@ -614,10 +476,6 @@ public function plusDays(int $days) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified period in hours added. - * - * @param int $hours - * - * @return ZonedDateTime */ public function plusHours(int $hours) : ZonedDateTime { @@ -626,10 +484,6 @@ public function plusHours(int $hours) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified period in minutes added. - * - * @param int $minutes - * - * @return ZonedDateTime */ public function plusMinutes(int $minutes) : ZonedDateTime { @@ -638,10 +492,6 @@ public function plusMinutes(int $minutes) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified period in seconds added. - * - * @param int $seconds - * - * @return ZonedDateTime */ public function plusSeconds(int $seconds) : ZonedDateTime { @@ -650,10 +500,6 @@ public function plusSeconds(int $seconds) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified Period subtracted. - * - * @param Period $period - * - * @return ZonedDateTime */ public function minusPeriod(Period $period) : ZonedDateTime { @@ -662,10 +508,6 @@ public function minusPeriod(Period $period) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified Duration subtracted. - * - * @param Duration $duration - * - * @return ZonedDateTime */ public function minusDuration(Duration $duration) : ZonedDateTime { @@ -674,10 +516,6 @@ public function minusDuration(Duration $duration) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified period in years subtracted. - * - * @param int $years - * - * @return ZonedDateTime */ public function minusYears(int $years) : ZonedDateTime { @@ -686,10 +524,6 @@ public function minusYears(int $years) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified period in months subtracted. - * - * @param int $months - * - * @return ZonedDateTime */ public function minusMonths(int $months) : ZonedDateTime { @@ -698,10 +532,6 @@ public function minusMonths(int $months) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified period in weeks subtracted. - * - * @param int $weeks - * - * @return ZonedDateTime */ public function minusWeeks(int $weeks) : ZonedDateTime { @@ -710,10 +540,6 @@ public function minusWeeks(int $weeks) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified period in days subtracted. - * - * @param int $days - * - * @return ZonedDateTime */ public function minusDays(int $days) : ZonedDateTime { @@ -722,10 +548,6 @@ public function minusDays(int $days) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified period in hours subtracted. - * - * @param int $hours - * - * @return ZonedDateTime */ public function minusHours(int $hours) : ZonedDateTime { @@ -734,10 +556,6 @@ public function minusHours(int $hours) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified period in minutes subtracted. - * - * @param int $minutes - * - * @return ZonedDateTime */ public function minusMinutes(int $minutes) : ZonedDateTime { @@ -746,10 +564,6 @@ public function minusMinutes(int $minutes) : ZonedDateTime /** * Returns a copy of this ZonedDateTime with the specified period in seconds subtracted. - * - * @param int $seconds - * - * @return ZonedDateTime */ public function minusSeconds(int $seconds) : ZonedDateTime { @@ -761,8 +575,6 @@ public function minusSeconds(int $seconds) : ZonedDateTime * * The comparison is performed on the instant. * - * @param ZonedDateTime $that - * * @return int [-1,0,1] If this zoned date-time is before, on, or after the given one. */ public function compareTo(ZonedDateTime $that) : int @@ -773,9 +585,7 @@ public function compareTo(ZonedDateTime $that) : int /** * Returns whether this ZonedDateTime equals another. * - * @param ZonedDateTime $that - * - * @return bool + * The comparison is performed on the instant. */ public function isEqualTo(ZonedDateTime $that) : bool { @@ -785,9 +595,7 @@ public function isEqualTo(ZonedDateTime $that) : bool /** * Returns whether this ZonedDateTime is after another. * - * @param ZonedDateTime $that - * - * @return bool + * The comparison is performed on the instant. */ public function isAfter(ZonedDateTime $that) : bool { @@ -797,9 +605,7 @@ public function isAfter(ZonedDateTime $that) : bool /** * Returns whether this ZonedDateTime is after or equal to another. * - * @param ZonedDateTime $that - * - * @return bool + * The comparison is performed on the instant. */ public function isAfterOrEqualTo(ZonedDateTime $that) : bool { @@ -809,9 +615,7 @@ public function isAfterOrEqualTo(ZonedDateTime $that) : bool /** * Returns whether this ZonedDateTime is before another. * - * @param ZonedDateTime $that - * - * @return bool + * The comparison is performed on the instant. */ public function isBefore(ZonedDateTime $that) : bool { @@ -821,32 +625,18 @@ public function isBefore(ZonedDateTime $that) : bool /** * Returns whether this ZonedDateTime is before or equal to another. * - * @param ZonedDateTime $that - * - * @return bool + * The comparison is performed on the instant. */ public function isBeforeOrEqualTo(ZonedDateTime $that) : bool { return $this->compareTo($that) <= 0; } - /** - * @param ZonedDateTime $from - * @param ZonedDateTime $to - * - * @return bool - */ public function isBetweenInclusive(ZonedDateTime $from, ZonedDateTime $to) : bool { return $this->isAfterOrEqualTo($from) && $this->isBeforeOrEqualTo($to); } - /** - * @param ZonedDateTime $from - * @param ZonedDateTime $to - * - * @return bool - */ public function isBetweenExclusive(ZonedDateTime $from, ZonedDateTime $to) : bool { return $this->isAfter($from) && $this->isBefore($to); @@ -856,10 +646,6 @@ public function isBetweenExclusive(ZonedDateTime $from, ZonedDateTime $to) : boo * Returns whether this ZonedDateTime is in the future, according to the given clock. * * If no clock is provided, the system clock is used. - * - * @param Clock|null $clock - * - * @return bool */ public function isFuture(?Clock $clock = null) : bool { @@ -870,10 +656,6 @@ public function isFuture(?Clock $clock = null) : bool * Returns whether this ZonedDateTime is in the past, according to the given clock. * * If no clock is provided, the system clock is used. - * - * @param Clock|null $clock - * - * @return bool */ public function isPast(?Clock $clock = null) : bool { @@ -885,8 +667,6 @@ public function isPast(?Clock $clock = null) : bool * * Note that the native DateTime object supports a precision up to the microsecond, * so the nanoseconds are rounded down to the nearest microsecond. - * - * @return \DateTime */ public function toDateTime() : \DateTime { @@ -912,9 +692,6 @@ public function toDateTime() : \DateTime return \DateTime::createFromFormat($format, $dateTime, $dateTimeZone); } - /** - * @return \DateTimeImmutable - */ public function toDateTimeImmutable() : \DateTimeImmutable { return \DateTimeImmutable::createFromMutable($this->toDateTime()); @@ -922,17 +699,12 @@ public function toDateTimeImmutable() : \DateTimeImmutable /** * Serializes as a string using {@see ZonedDateTime::__toString()}. - * - * @return string */ public function jsonSerialize() : string { return (string) $this; } - /** - * @return string - */ public function __toString() : string { $string = $this->localDateTime . $this->timeZoneOffset;