Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2']
php-version: ['8.4']
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we only testing on 8.4 when the php constraint is >=8.0?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer-lowest: ['']
include:
- php-version: '7.2'
prefer-lowest: 'prefer-lowest'

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -56,19 +53,19 @@ jobs:
fi

- name: Setup problem matchers for PHPUnit
if: matrix.php-version == '7.4'
if: matrix.php-version == '8.4'
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Run PHPUnit
run: |
if [[ ${{ matrix.php-version }} == '7.4' ]]; then
if [[ ${{ matrix.php-version }} == '8.4' ]]; then
export CODECOVERAGE=1 && vendor/bin/phpunit --verbose --coverage-clover=coverage.xml
else
vendor/bin/phpunit
fi

- name: Submit code coverage
if: matrix.php-version == '7.4'
if: matrix.php-version == '8.4'
uses: codecov/codecov-action@v3

cs-stan:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"source": "https://github.com/cakephp/chronos"
},
"require": {
"php": ">=7.2"
"php": ">=8.0"
},
"require-dev": {
"phpunit/phpunit": "^8.0 || ^9.0",
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/FactoryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,11 @@ public static function createFromArray(array $values): ChronosInterface
/**
* Create a ChronosInterface instance from a timestamp
*
* @param int $timestamp The timestamp to create an instance from.
* @param float|int $timestamp The timestamp to create an instance from.
* @param \DateTimeZone|string|null $tz The DateTimeZone object or timezone name the new instance should use.
* @return static
*/
public static function createFromTimestamp(int $timestamp, $tz = null): ChronosInterface
public static function createFromTimestamp(float|int $timestamp, $tz = null): ChronosInterface
{
$instance = static::now($tz)->setTimestamp($timestamp);
if (get_class($instance) === ChronosDate::class) {
Expand Down
Loading