Skip to content

Commit

Permalink
Allow Carbon v3 (#185)
Browse files Browse the repository at this point in the history
* Update composer.json

* Update ignore phpunit cache

Signed-off-by: Lloric Mayuga Garcia <[email protected]>

* Add `--ci` on test

Signed-off-by: Lloric Mayuga Garcia <[email protected]>

* Matrix for carbon

Signed-off-by: Lloric Mayuga Garcia <[email protected]>

* Fix test regarding carbon v3

Signed-off-by: Lloric Mayuga Garcia <[email protected]>

---------

Signed-off-by: Lloric Mayuga Garcia <[email protected]>
  • Loading branch information
lloricode authored Mar 25, 2024
1 parent 61f0da7 commit 6a5e378
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.idea
.php_cs
.php_cs.cache
.phpunit.result.cache
.phpunit.cache
build
composer.lock
coverage
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 1 addition & 3 deletions src/SslCertificate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6a5e378

Please sign in to comment.