Skip to content

Commit 3bbcc16

Browse files
committed
Allow float timestamp argument for createFromTimestamp to match PHP 8.4
1 parent 5362aa1 commit 3bbcc16

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Traits/FactoryTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,11 @@ public static function createFromArray(array $values): ChronosInterface
332332
/**
333333
* Create a ChronosInterface instance from a timestamp
334334
*
335-
* @param int $timestamp The timestamp to create an instance from.
335+
* @param float|int $timestamp The timestamp to create an instance from.
336336
* @param \DateTimeZone|string|null $tz The DateTimeZone object or timezone name the new instance should use.
337337
* @return static
338338
*/
339-
public static function createFromTimestamp(int $timestamp, $tz = null): ChronosInterface
339+
public static function createFromTimestamp(float|int $timestamp, $tz = null): ChronosInterface
340340
{
341341
$instance = static::now($tz)->setTimestamp($timestamp);
342342
if (get_class($instance) === ChronosDate::class) {

0 commit comments

Comments
 (0)