Skip to content

Commit 9df7e09

Browse files
Add Laravel 12 support + deprecations fixes
1 parent 09ec243 commit 9df7e09

File tree

8 files changed

+37
-33
lines changed

8 files changed

+37
-33
lines changed

.claude/settings.local.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(./vendor/bin/phpunit --migrate-configuration)",
5+
"Bash(composer update:*)",
6+
"Bash(./vendor/bin/phpunit)",
7+
"Bash(./vendor/bin/phpunit --display-all-issues)"
8+
]
9+
},
10+
"enableAllProjectMcpServers": false
11+
}

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Run tests
22

33
on:
44
push:
5-
schedule:
6-
- cron: '0 0 * * *'
75

86
jobs:
97
test:
@@ -12,12 +10,14 @@ jobs:
1210
strategy:
1311
fail-fast: false
1412
matrix:
15-
php: [8.1, 8.2, 8.3]
16-
laravel: [10.*, 11.*]
13+
php: [8.1, 8.2, 8.3, 8.4]
14+
laravel: [10.*, 11.*, 12.*]
1715
dependency-version: [prefer-lowest, prefer-stable]
1816
exclude:
1917
- php: 8.1
2018
laravel: 11.*
19+
- php: 8.1
20+
laravel: 12.*
2121

2222
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
2323

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ composer.phar
33
composer.lock
44
vendor
55
.php_cs.cache
6-
.phpunit.result.cache
6+
.phpunit.result.cache
7+
.phpunit.cache

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
},
99
"require": {
1010
"php": "^8.1",
11-
"illuminate/support": "^10.0|^11.0",
11+
"illuminate/support": "^10.0|^11.0|^12.0",
1212
"nesbot/carbon": "^2.0"
1313
},
1414
"require-dev": {
15-
"phpunit/phpunit": "^9.5"
15+
"phpunit/phpunit": "^10.5|^11.0"
1616
},
1717
"config": {
1818
"optimize-autoloader": true,

phpunit.xml

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false">
11-
<testsuites>
12-
<testsuite name="Package Test Suite">
13-
<directory>./tests/</directory>
14-
</testsuite>
15-
</testsuites>
16-
<filter>
17-
<whitelist>
18-
<directory suffix=".php">src/</directory>
19-
</whitelist>
20-
</filter>
21-
<php>
22-
<ini name="display_errors" value="1"/>
23-
</php>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<testsuites>
4+
<testsuite name="Package Test Suite">
5+
<directory>./tests/</directory>
6+
</testsuite>
7+
</testsuites>
8+
<php>
9+
<ini name="display_errors" value="1"/>
10+
</php>
11+
<source>
12+
<include>
13+
<directory suffix=".php">src/</directory>
14+
</include>
15+
</source>
2416
</phpunit>

src/Duration/Duration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public static function fromArray($exported)
124124
/**
125125
* @return array
126126
*/
127-
public function jsonSerialize()
127+
public function jsonSerialize(): mixed
128128
{
129129
return $this->toArray();
130130
}

src/Period/Period.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static function fromArray(array $exported)
5151
/**
5252
* @return array
5353
*/
54-
public function jsonSerialize()
54+
public function jsonSerialize(): mixed
5555
{
5656
return $this->toArray();
5757
}

src/Whitelist/Whitelist.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct($value)
2424
if (! static::isValid($value)) {
2525
throw new static::$exceptionClass('Invalid value '.$value);
2626
}
27-
$this->status = $value;
27+
$this->value = $value;
2828
}
2929

3030
/**
@@ -40,7 +40,7 @@ public function __toString()
4040
*/
4141
public function get()
4242
{
43-
return $this->status;
43+
return $this->value;
4444
}
4545

4646
/**

0 commit comments

Comments
 (0)