Skip to content

Commit 5dca8dc

Browse files
author
Emre Çalışkan
committed
Fixes for PHP 8.4
1 parent 8c3e607 commit 5dca8dc

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

src/Carbon/CarbonInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,7 @@ public static function createFromTimeString($time, $tz = null);
11621162
*
11631163
* @return static
11641164
*/
1165+
#[ReturnTypeWillChange]
11651166
public static function createFromTimestamp($timestamp, $tz = null);
11661167

11671168
/**

src/Carbon/Traits/Timestamp.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ trait Timestamp
2626
*
2727
* @return static
2828
*/
29+
#[\ReturnTypeWillChange]
2930
public static function createFromTimestamp($timestamp, $tz = null)
3031
{
3132
return static::createFromTimestampUTC($timestamp)->setTimezone($tz);

tests/Carbon/SettersTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public function testTimestampSetter()
241241
$d->timestamp = 1600887164.88952298;
242242
$this->assertSame('2020-09-23 14:52:44.889523', $d->format('Y-m-d H:i:s.u'));
243243

244-
$d->setTimestamp(1599828571.23561248);
244+
$d->setTimestamp(1599828571.235612);
245245
$this->assertSame('2020-09-11 08:49:31.235612', $d->format('Y-m-d H:i:s.u'));
246246

247247
$d->timestamp = '0.88951247 1600887164';

tests/CarbonPeriod/Fixtures/AbstractCarbon.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,10 @@ public static function createFromFormat($format, $time, $tz = null)
8282
{
8383
return parent::createFromFormat($format, $time, $tz);
8484
}
85+
86+
#[ReturnTypeWillChange]
87+
public static function createFromTimestamp($timestamp, $tz = null)
88+
{
89+
return parent::createFromTimestamp($timestamp, $tz);
90+
}
8591
}

0 commit comments

Comments
 (0)