diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 9c57013..9d6300d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -12,8 +12,9 @@ jobs: os: [ubuntu-latest] php: [8.3, 8.2, 8.1] dependency-version: [prefer-lowest, prefer-stable] + carbon: [^2.68.1, ^3.0] - name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} + name: P${{ matrix.php }} - Carbon${{ matrix.carbon }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} steps: - name: Checkout code @@ -27,7 +28,9 @@ jobs: coverage: none - name: Install dependencies - run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest + run: | + composer require "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest - name: Execute tests - run: vendor/bin/pest + run: vendor/bin/pest --ci diff --git a/.gitignore b/.gitignore index adc6804..8218fc7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .idea .php_cs .php_cs.cache -.phpunit.result.cache +.phpunit.cache build composer.lock coverage diff --git a/composer.json b/composer.json index 9d4ab59..8f644d6 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "php": "^8.1", "ext-intl": "*", "ext-json": "*", - "nesbot/carbon": "^2.68.1", + "nesbot/carbon": "^2.68.1|^3.0", "spatie/macroable": "^2.0" }, "require-dev": { diff --git a/src/SslCertificate.php b/src/SslCertificate.php index d41fb84..9679660 100644 --- a/src/SslCertificate.php +++ b/src/SslCertificate.php @@ -216,9 +216,7 @@ public function daysUntilExpirationDate(): int { $endDate = $this->expirationDate(); - $interval = Carbon::now()->diff($endDate); - - return (int) $interval->format('%r%a'); + return (int) Carbon::now()->diffInDays($endDate); } public function getDomains(): array