Skip to content

Commit 1aa8422

Browse files
committed
Allow float timestamp argument for createFromTimestamp to match PHP 8.4
1 parent b0321ab commit 1aa8422

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
php-version: ['7.4', '8.0', '8.1', '8.2']
20+
php-version: ['8.4']
2121
prefer-lowest: ['']
2222
include:
23-
- php-version: '7.2'
23+
- php-version: '8.4'
2424
prefer-lowest: 'prefer-lowest'
2525

2626
steps:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"source": "https://github.com/cakephp/chronos"
2626
},
2727
"require": {
28-
"php": ">=7.2"
28+
"php": ">=8.0"
2929
},
3030
"require-dev": {
3131
"phpunit/phpunit": "^8.0 || ^9.0",

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)