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
52 changes: 2 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,56 +15,8 @@ permissions:

jobs:
testsuite:
runs-on: ubuntu-22.04
continue-on-error: ${{ matrix.unstable }}
strategy:
fail-fast: false
matrix:
php-version: ['8.1']
dependencies: [highest]
unstable: [false]
include:
- php-version: '8.1'
dependencies: lowest
unstable: false
- php-version: '8.2'
dependencies: highest
unstable: false
- php-version: '8.3'
dependencies: highest
unstable: false
- php-version: '8.4'
dependencies: highest
unstable: true

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl
ini-values: zend.assertions=1
coverage: pcov

- name: Composer install
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: ${{ matrix.composer-options }}

- name: Run PHPUnit
run: |
if [[ ${{ matrix.php-version }} == '8.1' && ${{ matrix.dependencies }} == 'highest' ]]; then
export CODECOVERAGE=1 && vendor/bin/phpunit --display-deprecations --display-warnings --display-incomplete --display-skipped --coverage-clover=coverage.xml
else
vendor/bin/phpunit --display-deprecations --display-warnings
fi

- name: Code Coverage Report
if: success() && matrix.php-version == '8.1' && matrix.dependencies == 'highest'
uses: codecov/codecov-action@v5
uses: cakephp/.github/.github/workflows/testsuite-without-db.yml@5.x
secrets: inherit

cs-stan:
uses: cakephp/.github/.github/workflows/cs-stan.yml@5.x
Expand Down
3 changes: 1 addition & 2 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpstan" version="2.1.0" installed="2.1.0" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="5.26.1" installed="5.26.1" location="./tools/psalm" copy="false"/>
<phar name="phpstan" version="2.1.17" installed="2.1.17" location="./tools/phpstan" copy="false"/>
</phive>
3 changes: 0 additions & 3 deletions .stickler.yml

This file was deleted.

7 changes: 1 addition & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,7 @@
"cs-check": "phpcs --colors --parallel=16 -p",
"cs-fix": "phpcbf --colors --parallel=16 -p",
"phpstan": "tools/phpstan analyse",
"psalm": "tools/psalm --show-info=false",
"psalm-baseline": "tools/psalm --set-baseline=psalm-baseline.xml",
"stan": [
"@phpstan",
"@psalm"
],
"stan": "@phpstan",
"stan-baseline": "tools/phpstan --generate-baseline",
"stan-setup": "phive install",
"test": "phpunit"
Expand Down
152 changes: 0 additions & 152 deletions psalm-baseline.xml

This file was deleted.

19 changes: 0 additions & 19 deletions psalm.xml

This file was deleted.

4 changes: 2 additions & 2 deletions src/Chronos.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
* @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise
* @property-read string $timezoneName
* @property-read string $tzName
* @psalm-immutable
* @psalm-consistent-constructor
* @immutable
* @phpstan-consistent-constructor
*/
class Chronos extends DateTimeImmutable implements Stringable
{
Expand Down
9 changes: 5 additions & 4 deletions src/ChronosDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
* @property-read int $age does a diffInYears() with default parameters
* @property-read int<1, 4> $quarter the quarter of this instance, 1 - 4
* @property-read int<1, 2> $half the half of the year, with 1 for months Jan...Jun and 2 for Jul...Dec.
* @psalm-immutable
* @psalm-consistent-constructor
* @immutable
* @phpstan-consistent-constructor
*/
class ChronosDate implements Stringable
{
Expand Down Expand Up @@ -354,10 +354,11 @@ public function modify(string $modifier): static
}

$new = clone $this;
$new->native = $new->native->modify($modifier);
if ($new->native === false) {
$native = $new->native->modify($modifier);
if ($native === false) {
throw new InvalidArgumentException(sprintf('Unable to modify date using `%s`', $modifier));
}
$new->native = $native;

if ($new->format('H:i:s') !== '00:00:00') {
$new->native = $new->native->setTime(0, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/ChronosTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use Stringable;

/**
* @psalm-consistent-constructor
* @phpstan-consistent-constructor
*/
class ChronosTime implements Stringable
{
Expand Down
1 change: 0 additions & 1 deletion tests/TestCase/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ protected function withTimezone(string $tz, Closure $cb)
*/
public function deprecated(Closure $callable): void
{
/** @var bool $deprecation Expand type for psalm */
$deprecation = false;

$previousHandler = set_error_handler(
Expand Down