Skip to content

Commit 338c7b0

Browse files
authored
Update Timestamp.php
When using PHP 8.4, I get the following error: ``` Deprecated: Return type of Carbon\Traits\Date::createFromTimestamp($timestamp, $tz = null) should either be compatible with DateTime::createFromTimestamp(int|float $timestamp): static, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in nesbot/carbon/src/Carbon/Traits/Timestamp.php on line 29 ``` I am adding the annotation to resolve this issue.
1 parent ff2f20c commit 338c7b0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Carbon/Traits/Timestamp.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ trait Timestamp
2525
*
2626
* Timestamp input can be given as int, float or a string containing one or more numbers.
2727
*/
28+
#[\ReturnTypeWillChange]
2829
public static function createFromTimestamp(
2930
float|int|string $timestamp,
3031
DateTimeZone|string|int|null $timezone = null,

0 commit comments

Comments
 (0)