Skip to content

Commit 45407af

Browse files
Drop Laravel 10 support
1 parent 20363bf commit 45407af

File tree

6 files changed

+32
-39
lines changed

6 files changed

+32
-39
lines changed

.github/workflows/phpunit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
strategy:
1010
fail-fast: true
1111
matrix:
12-
php: [ "8.2", "8.3" ]
13-
laravel: [ "10.0", "11.0" ]
12+
php: [ "8.2", "8.3", "8.4" ]
13+
laravel: [ "11.0" ]
1414

1515
name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }}
1616

UPGRADE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
### PHP 8.2 Required
66

7-
Laravel Cache now required PHP 8.2.0 or greater.
7+
`Laravel Cache` now required PHP 8.2.0 or greater.
88

9-
### Laravel 10+ Required
9+
### Laravel 11+ Required
1010

11-
Laravel Cache now required Laravel Framework 10 or greater.
11+
`Laravel Cache` now required Laravel Framework 11 or greater.
1212

1313
### Composer Dependencies
1414

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
"require": {
3636
"php": "^8.2",
3737
"dragon-code/support": "^6.11.3",
38-
"illuminate/contracts": "^10.0 || ^11.0",
39-
"illuminate/support": "^10.0 || ^11.0"
38+
"illuminate/contracts": "^11.0",
39+
"illuminate/support": "^11.0"
4040
},
4141
"require-dev": {
4242
"nesbot/carbon": "^2.62",

phpunit.xml

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,30 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
4-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
backupGlobals="false"
6-
backupStaticAttributes="false"
7-
bootstrap="vendor/autoload.php"
8-
colors="true"
9-
convertErrorsToExceptions="true"
10-
convertNoticesToExceptions="false"
11-
convertWarningsToExceptions="false"
12-
processIsolation="false"
13-
stopOnError="false"
14-
stopOnFailure="false"
15-
verbose="true"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
cacheResult="false"
167
>
17-
<coverage processUncoveredFiles="true">
18-
<include>
19-
<directory suffix=".php">./src</directory>
20-
</include>
8+
<coverage>
219
<report>
22-
<clover outputFile="build/logs/clover.xml"/>
23-
<html outputDirectory="build/logs/coverage"/>
24-
<text outputFile="build/logs/coverage.txt"/>
10+
<clover outputFile="build/logs/clover.xml" />
11+
<html outputDirectory="build/logs/coverage" />
12+
<text outputFile="build/logs/coverage.txt" />
2513
</report>
2614
</coverage>
2715
<php>
28-
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
29-
<env name="REDIS_HOST" value="127.0.0.1"/>
30-
<env name="REDIS_PORT" value="6379"/>
16+
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF" />
17+
<env name="REDIS_HOST" value="127.0.0.1" />
18+
<env name="REDIS_PORT" value="6379" />
3119
</php>
3220
<testsuites>
3321
<testsuite name="Test Suite">
34-
<directory suffix="Test.php">./tests</directory>
22+
<directory>./tests</directory>
3523
</testsuite>
3624
</testsuites>
25+
<source>
26+
<include>
27+
<directory>./src</directory>
28+
</include>
29+
</source>
3730
</phpunit>

src/Support/Ttl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function fromSeconds($seconds): int
3232

3333
public function fromDateTime(DateTimeInterface $date_time): int
3434
{
35-
$seconds = Carbon::now()->diffInRealSeconds($date_time);
35+
$seconds = Carbon::now()->diffInSeconds($date_time);
3636

3737
return $this->correct($seconds);
3838
}

tests/Support/TtlTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testCarbon(): void
3434
{
3535
$ttl = Carbon::now()->addDay();
3636

37-
$expected = Carbon::now()->diffInRealSeconds($ttl);
37+
$expected = (int) Carbon::now()->diffInSeconds($ttl);
3838

3939
$this->assertSame($expected, Ttl::fromMinutes($ttl));
4040
$this->assertSame($expected, Ttl::fromSeconds($ttl));
@@ -44,7 +44,7 @@ public function testDateTimeInterface(): void
4444
{
4545
$ttl = new DateTime('tomorrow');
4646

47-
$expected = Carbon::now()->diffInRealSeconds($ttl);
47+
$expected = (int) Carbon::now()->diffInSeconds($ttl);
4848

4949
$this->assertSame($expected, Ttl::fromMinutes($ttl));
5050
$this->assertSame($expected, Ttl::fromSeconds($ttl));
@@ -95,11 +95,11 @@ public function testObjectAsObject(): void
9595

9696
public function testInstances(): void
9797
{
98-
$this->assertSame(3600, Ttl::fromMinutes((new AsCarbon('foo'))->cacheTtl()));
99-
$this->assertSame(7200, Ttl::fromSeconds((new AsCarbon('bar'))->cacheTtl()));
98+
$this->assertSame(3599, Ttl::fromMinutes((new AsCarbon('foo'))->cacheTtl()));
99+
$this->assertSame(7199, Ttl::fromSeconds((new AsCarbon('bar'))->cacheTtl()));
100100

101-
$this->assertSame(3600, Ttl::fromMinutes((new AsDateTime('foo'))->cacheTtl()));
102-
$this->assertSame(7200, Ttl::fromSeconds((new AsDateTime('bar'))->cacheTtl()));
101+
$this->assertSame(3599, Ttl::fromMinutes((new AsDateTime('foo'))->cacheTtl()));
102+
$this->assertSame(7199, Ttl::fromSeconds((new AsDateTime('bar'))->cacheTtl()));
103103

104104
$this->assertSame(600, Ttl::fromMinutes((new AsInteger('foo'))->cacheTtl()));
105105
$this->assertSame(20, Ttl::fromSeconds((new AsInteger('bar'))->cacheTtl()));

0 commit comments

Comments
 (0)