Skip to content

Commit 378b848

Browse files
ondrejmirtesisfedorov
authored andcommitted
Fixed NoDiscard attributes
1 parent fcba4c1 commit 378b848

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

date/date_c.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ public function __construct(
228228
* @link https://secure.php.net/manual/en/datetimeimmutable.add.php
229229
*/
230230
#[TentativeType]
231+
#[\NoDiscard(message: "as DateTimeImmutable::add() does not modify the object itself")]
231232
public function add(DateInterval $interval): DateTimeImmutable {}
232233

233234
/**
@@ -339,6 +340,7 @@ public static function __set_state(array $array) {}
339340
* Returns the {@link https://secure.php.net/manual/en/class.datetimeimmutable.php DateTimeImmutable} object for method chaining or <b>FALSE</b> on failure.
340341
*/
341342
#[TentativeType]
343+
#[\NoDiscard(message: "as DateTimeImmutable::setDate() does not modify the object itself")]
342344
public function setDate(
343345
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $year,
344346
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $month,
@@ -356,6 +358,7 @@ public function setDate(
356358
* Returns the {@link https://secure.php.net/manual/en/class.datetimeimmutable.php DateTimeImmutable} object for method chaining or <b>FALSE</b> on failure.
357359
*/
358360
#[TentativeType]
361+
#[\NoDiscard(message: "as DateTimeImmutable::setISODate() does not modify the object itself")]
359362
public function setISODate(
360363
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $year,
361364
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $week,
@@ -374,6 +377,7 @@ public function setISODate(
374377
* Returns the {@link https://secure.php.net/manual/en/class.datetimeimmutable.php DateTimeImmutable} object for method chaining or <b>FALSE</b> on failure.
375378
*/
376379
#[TentativeType]
380+
#[\NoDiscard(message: "as DateTimeImmutable::setTime() does not modify the object itself")]
377381
public function setTime(
378382
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $hour,
379383
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $minute,
@@ -390,6 +394,7 @@ public function setTime(
390394
* Returns the {@link https://secure.php.net/manual/en/class.datetimeimmutable.php DateTimeImmutable} object for method chaining or <b>FALSE</b> on failure.
391395
*/
392396
#[TentativeType]
397+
#[\NoDiscard(message: "as DateTimeImmutable::setTimestamp() does not modify the object itself")]
393398
public function setTimestamp(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestamp): DateTimeImmutable {}
394399

395400
/**
@@ -404,6 +409,7 @@ public function setTimestamp(#[LanguageLevelTypeAware(['8.0' => 'int'], default:
404409
* Returns the {@link https://secure.php.net/manual/en/class.datetimeimmutable.php DateTimeImmutable} object for method chaining or <b>FALSE</b> on failure.
405410
*/
406411
#[TentativeType]
412+
#[\NoDiscard(message: "as DateTimeImmutable::setTimezone() does not modify the object itself")]
407413
public function setTimezone(DateTimeZone $timezone): DateTimeImmutable {}
408414

409415
/**
@@ -418,6 +424,7 @@ public function setTimezone(DateTimeZone $timezone): DateTimeImmutable {}
418424
* Returns the {@link https://secure.php.net/manual/en/class.datetimeimmutable.php DateTimeImmutable} object for method chaining or <b>FALSE</b> on failure.
419425
*/
420426
#[TentativeType]
427+
#[\NoDiscard(message: "as DateTimeImmutable::sub() does not modify the object itself")]
421428
public function sub(DateInterval $interval): DateTimeImmutable {}
422429

423430
/**
@@ -516,6 +523,7 @@ public function getMicrosecond(): int {}
516523
/**
517524
* @since 8.4
518525
*/
526+
#[\NoDiscard(message: "as DateTimeImmutable::setMicrosecond() does not modify the object itself")]
519527
public function setMicrosecond(int $microsecond): static {}
520528
}
521529

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

713720
/**
@@ -727,7 +734,6 @@ public static function createFromImmutable(DateTimeImmutable $object) {}
727734
* @throws DateInvalidOperationException
728735
*/
729736
#[TentativeType]
730-
#[\NoDiscard(message: "as DateTimeImmutable::sub() does not modify the object itself")]
731737
public function sub(DateInterval $interval): DateTime {}
732738

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

751756
/**
@@ -766,7 +771,6 @@ public function getOffset(): int {}
766771
* @link https://php.net/manual/en/datetime.settime.php
767772
*/
768773
#[TentativeType]
769-
#[\NoDiscard(message: "as DateTimeImmutable::setTime() does not modify the object itself")]
770774
public function setTime(
771775
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $hour,
772776
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $minute,
@@ -783,7 +787,6 @@ public function setTime(
783787
* @link https://php.net/manual/en/datetime.setdate.php
784788
*/
785789
#[TentativeType]
786-
#[\NoDiscard(message: "as DateTimeImmutable::setDate() does not modify the object itself")]
787790
public function setDate(
788791
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $year,
789792
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $month,
@@ -799,7 +802,6 @@ public function setDate(
799802
* @link https://php.net/manual/en/datetime.setisodate.php
800803
*/
801804
#[TentativeType]
802-
#[\NoDiscard(message: "as DateTimeImmutable::setISODate() does not modify the object itself")]
803805
public function setISODate(
804806
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $year,
805807
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $week,
@@ -813,7 +815,6 @@ public function setISODate(
813815
* @link https://php.net/manual/en/datetime.settimestamp.php
814816
*/
815817
#[TentativeType]
816-
#[\NoDiscard(message: "as DateTimeImmutable::setTimestamp() does not modify the object itself")]
817818
public function setTimestamp(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestamp): DateTime {}
818819

819820
/**
@@ -914,7 +915,6 @@ public function getMicrosecond(): int {}
914915
/**
915916
* @since 8.4
916917
*/
917-
#[\NoDiscard(message: "as DateTimeImmutable::setMicrosecond() does not modify the object itself")]
918918
public function setMicrosecond(int $microsecond): static {}
919919
}
920920

0 commit comments

Comments
 (0)