Skip to content

Commit 6ae654b

Browse files
authored
Add support for PHP 8.4
1 parent bee1f07 commit 6ae654b

File tree

6 files changed

+12
-24
lines changed

6 files changed

+12
-24
lines changed

.github/workflows/tests.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
php: [7.4, 8.0, 8.1, 8.2, 8.3]
13+
php: [7.4, 8.0, 8.1, 8.2, 8.3, 8.4]
1414
experimental: [false]
1515
include:
1616
- php: 8.2
@@ -27,7 +27,12 @@ jobs:
2727
coverage: xdebug
2828

2929
- name: Install dependencies with Composer
30-
uses: ramsey/composer-install@v3
30+
if: matrix.php < '8.4'
31+
run: composer update --prefer-dist --no-progress --no-interaction --ansi
32+
33+
- name: Install dependencies with Composer
34+
if: matrix.php >= '8.4'
35+
run: composer update --prefer-dist --no-progress --no-interaction --ansi --ignore-platform-reqs
3136

3237
- name: Coding standards
3338
if: matrix.analysis

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66

77
### Added
88

9-
### Removed
9+
- Add support for PHP 8.4
1010

11+
### Removed
1112

1213
## 4.14.0 - 2024-06-13
1314

Slim/Handlers/Strategies/RequestResponseNamedArgs.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@
2121
*/
2222
class RequestResponseNamedArgs implements InvocationStrategyInterface
2323
{
24-
public function __construct()
25-
{
26-
if (PHP_VERSION_ID < 80000) {
27-
throw new RuntimeException('Named arguments are only available for PHP >= 8.0.0');
28-
}
29-
}
30-
3124
/**
3225
* Invoke a route callable with request, response and all route parameters
3326
* as individual arguments.

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"wiki": "https://github.com/slimphp/Slim/wiki"
4444
},
4545
"require": {
46-
"php": "^7.4 || ^8.0",
46+
"php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
4747
"ext-json": "*",
4848
"nikic/fast-route": "^1.3",
4949
"psr/container": "^1.0 || ^2.0",
@@ -69,7 +69,7 @@
6969
"slim/http": "^1.3",
7070
"slim/psr7": "^1.6",
7171
"squizlabs/php_codesniffer": "^3.10",
72-
"vimeo/psalm": "^5.24"
72+
"vimeo/psalm": "^5.26.1"
7373
},
7474
"autoload": {
7575
"psr-4": {

tests/Handlers/Strategies/RequestResponseNamedArgsTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
use Psr\Http\Message\ResponseInterface;
1414
use Psr\Http\Message\ServerRequestInterface;
15-
use RuntimeException;
1615
use Slim\Handlers\Strategies\RequestResponseNamedArgs;
1716
use Slim\Tests\TestCase;
1817

@@ -29,16 +28,6 @@ public function setUp(): void
2928
$this->response = $this->createMock(ResponseInterface::class);
3029
}
3130

32-
public function testCreatingRequestResponseNamedArgsThrowsRuntimeExceptionForPHPOlderThan80()
33-
{
34-
if (PHP_VERSION_ID >= self::PHP_8_0_VERSION_ID) {
35-
$this->markTestSkipped('Test only valid for PHP versions older than 8.0');
36-
}
37-
38-
$this->expectException(RuntimeException::class);
39-
new RequestResponseNamedArgs();
40-
}
41-
4231
public function testCallingWithEmptyArguments()
4332
{
4433
if (PHP_VERSION_ID < self::PHP_8_0_VERSION_ID) {

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
return connection_status();
2626
},
27-
'header' => function (string $string, bool $replace = true, int $statusCode = null): void {
27+
'header' => function (string $string, bool $replace = true, ?int $statusCode = null): void {
2828
HeaderStack::push(
2929
[
3030
'header' => $string,

0 commit comments

Comments
 (0)