diff --git a/date/date_c.php b/date/date_c.php index 3ec4cda37..8da12b1ec 100644 --- a/date/date_c.php +++ b/date/date_c.php @@ -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) {} /** @@ -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 {} /** @@ -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 {} /** @@ -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 {} /** @@ -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, @@ -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, @@ -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, @@ -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 {} /** @@ -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 {} }