Skip to content

Commit 1d87edd

Browse files
Laravel 11 and 12 and PHP 8.4 (#3)
* 🔧 update to phpunit 10 * 🔧 support laravel 11 * Update PHP and Laravel support matrix, bump dependencies in composer.json * Downgrade PHP requirement to ^8.3 in composer.json * Expand orchestra/testbench dependency to allow ^10.0 & update constructor type hint in Response.php * Expand phpunit dependency to allow ^11.0 in composer.json --------- Co-authored-by: Daniel Cannon <Daniel@synergitech.co.uk>
1 parent 3ce6cd5 commit 1d87edd

File tree

4 files changed

+37
-40
lines changed

4 files changed

+37
-40
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
laravel: [8, 9, 10]
12-
php: ["8.0", 8.1, 8.2, 8.3]
13-
exclude:
14-
- php: "8.0"
15-
laravel: 10
11+
laravel: [11, 12]
12+
php: [8.4, 8.3]
1613

1714
steps:
18-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1916

2017
- name: test against Laravel ${{ matrix.laravel }} on PHP ${{ matrix.php }}
2118
run: docker build . --build-arg PHP_VERSION=${{ matrix.php }} --build-arg LARAVEL=${{ matrix.laravel }}

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
"salesforce"
88
],
99
"require": {
10-
"php": "^8.0",
11-
"illuminate/collections": "^8.0 || ^9.0 || ^10.0",
12-
"illuminate/support": "^8.0 || ^9.0 || ^10.0",
10+
"php": "^8.3",
11+
"illuminate/collections": "^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0",
12+
"illuminate/support": "^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0",
1313
"omniphx/forrest": "^2.0"
1414
},
1515
"require-dev": {
16-
"orchestra/testbench": "^6.0 || ^7.0 || ^8.0",
16+
"orchestra/testbench": "^8.0 || ^9.0 || ^10.0",
1717
"php-parallel-lint/php-parallel-lint": "^1.3",
1818
"phpstan/phpstan": "^1",
19-
"phpunit/phpunit": "^9.0",
19+
"phpunit/phpunit": "^10.0 || ^11.0",
2020
"squizlabs/php_codesniffer": "^3.6"
2121
},
2222
"autoload": {
@@ -40,4 +40,4 @@
4040
"phpstan analyse --level 9 src"
4141
]
4242
}
43-
}
43+
}

phpunit.xml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
<?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-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
12-
stopOnFailure="false">
13-
<testsuites>
14-
<testsuite name="alert-package-tests">
15-
<directory suffix="Test.php">./tests</directory>
16-
</testsuite>
17-
</testsuites>
18-
<coverage processUncoveredFiles="true">
19-
<report>
20-
<html outputDirectory="build/coverage"/>
21-
<text outputFile="php://stdout"/>
22-
</report>
23-
<include>
24-
<directory suffix=".php">./src</directory>
25-
</include>
26-
</coverage>
27-
</phpunit>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
backupStaticProperties="false"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
processIsolation="false"
7+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
9+
stopOnFailure="false"
10+
>
11+
<testsuites>
12+
<testsuite name="alert-package-tests">
13+
<directory suffix="Test.php">./tests</directory>
14+
</testsuite>
15+
</testsuites>
16+
<coverage>
17+
<report>
18+
<html outputDirectory="build/coverage"/>
19+
<text outputFile="php://stdout"/>
20+
</report>
21+
</coverage>
22+
<source>
23+
<include>
24+
<directory suffix=".php">./src</directory>
25+
</include>
26+
</source>
27+
</phpunit>

src/Models/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Response
2323
/**
2424
* @param string|array<string, mixed> $rawResponse
2525
*/
26-
public function __construct(protected string $query, string|array $rawResponse, int $currentPage = null)
26+
public function __construct(protected string $query, string|array $rawResponse, ?int $currentPage = null)
2727
{
2828
if (is_string($rawResponse)) {
2929
throw new InvalidResponseException('String response received - expected an array');

0 commit comments

Comments
 (0)