Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions date/date_c.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ public static function getLastErrors(): array|false {}
#[Pure]
#[TentativeType]
#[LanguageLevelTypeAware(['8.4' => 'DateTimeImmutable'], default: 'static|false')]
#[\NoDiscard(message: "as DateTimeImmutable::modify() does not modify the object itself")]
public function modify(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $modifier) {}

/**
Expand Down Expand Up @@ -706,6 +707,7 @@ public function modify(#[LanguageLevelTypeAware(['8.0' => 'string'], default: ''
* @link https://php.net/manual/en/datetime.add.php
*/
#[TentativeType]
#[\NoDiscard(message: "as DateTimeImmutable::add() does not modify the object itself")]
public function add(DateInterval $interval): DateTime {}

/**
Expand All @@ -725,6 +727,7 @@ public static function createFromImmutable(DateTimeImmutable $object) {}
* @throws DateInvalidOperationException
*/
#[TentativeType]
#[\NoDiscard(message: "as DateTimeImmutable::sub() does not modify the object itself")]
public function sub(DateInterval $interval): DateTime {}

/**
Expand All @@ -742,6 +745,7 @@ public function getTimezone(): DateTimeZone|false {}
* @link https://php.net/manual/en/datetime.settimezone.php
*/
#[TentativeType]
#[\NoDiscard(message: "as DateTimeImmutable::setTimezone() does not modify the object itself")]
public function setTimezone(#[LanguageLevelTypeAware(['8.0' => 'DateTimeZone'], default: '')] $timezone): DateTime {}

/**
Expand All @@ -762,6 +766,7 @@ public function getOffset(): int {}
* @link https://php.net/manual/en/datetime.settime.php
*/
#[TentativeType]
#[\NoDiscard(message: "as DateTimeImmutable::setTime() does not modify the object itself")]
public function setTime(
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $hour,
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $minute,
Expand All @@ -778,6 +783,7 @@ public function setTime(
* @link https://php.net/manual/en/datetime.setdate.php
*/
#[TentativeType]
#[\NoDiscard(message: "as DateTimeImmutable::setDate() does not modify the object itself")]
public function setDate(
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $year,
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $month,
Expand All @@ -793,6 +799,7 @@ public function setDate(
* @link https://php.net/manual/en/datetime.setisodate.php
*/
#[TentativeType]
#[\NoDiscard(message: "as DateTimeImmutable::setISODate() does not modify the object itself")]
public function setISODate(
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $year,
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $week,
Expand All @@ -806,6 +813,7 @@ public function setISODate(
* @link https://php.net/manual/en/datetime.settimestamp.php
*/
#[TentativeType]
#[\NoDiscard(message: "as DateTimeImmutable::setTimestamp() does not modify the object itself")]
public function setTimestamp(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestamp): DateTime {}

/**
Expand Down Expand Up @@ -906,6 +914,7 @@ public function getMicrosecond(): int {}
/**
* @since 8.4
*/
#[\NoDiscard(message: "as DateTimeImmutable::setMicrosecond() does not modify the object itself")]
public function setMicrosecond(int $microsecond): static {}
}

Expand Down