diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 45dc50948..87dbf99fa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: [7.4, 8.0, 8.1, 8.2, 8.3] + php: [7.4, 8.0, 8.1, 8.2, 8.3, 8.4] experimental: [false] include: - php: 8.2 @@ -27,7 +27,12 @@ jobs: coverage: xdebug - name: Install dependencies with Composer - uses: ramsey/composer-install@v3 + if: matrix.php < '8.4' + run: composer update --prefer-dist --no-progress --no-interaction --ansi + + - name: Install dependencies with Composer + if: matrix.php >= '8.4' + run: composer update --prefer-dist --no-progress --no-interaction --ansi --ignore-platform-reqs - name: Coding standards if: matrix.analysis diff --git a/CHANGELOG.md b/CHANGELOG.md index fe2ab4ba5..52dbc9985 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,9 @@ ### Added -### Removed +- Add support for PHP 8.4 +### Removed ## 4.14.0 - 2024-06-13 diff --git a/Slim/Handlers/Strategies/RequestResponseNamedArgs.php b/Slim/Handlers/Strategies/RequestResponseNamedArgs.php index f36059646..4153e113d 100644 --- a/Slim/Handlers/Strategies/RequestResponseNamedArgs.php +++ b/Slim/Handlers/Strategies/RequestResponseNamedArgs.php @@ -21,13 +21,6 @@ */ class RequestResponseNamedArgs implements InvocationStrategyInterface { - public function __construct() - { - if (PHP_VERSION_ID < 80000) { - throw new RuntimeException('Named arguments are only available for PHP >= 8.0.0'); - } - } - /** * Invoke a route callable with request, response and all route parameters * as individual arguments. diff --git a/composer.json b/composer.json index de7f66a66..a5057201d 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,7 @@ "wiki": "https://github.com/slimphp/Slim/wiki" }, "require": { - "php": "^7.4 || ^8.0", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", "ext-json": "*", "nikic/fast-route": "^1.3", "psr/container": "^1.0 || ^2.0", @@ -69,7 +69,7 @@ "slim/http": "^1.3", "slim/psr7": "^1.6", "squizlabs/php_codesniffer": "^3.10", - "vimeo/psalm": "^5.24" + "vimeo/psalm": "^5.26.1" }, "autoload": { "psr-4": { diff --git a/tests/Handlers/Strategies/RequestResponseNamedArgsTest.php b/tests/Handlers/Strategies/RequestResponseNamedArgsTest.php index 11ff7b45b..fb7821bc6 100644 --- a/tests/Handlers/Strategies/RequestResponseNamedArgsTest.php +++ b/tests/Handlers/Strategies/RequestResponseNamedArgsTest.php @@ -12,7 +12,6 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; -use RuntimeException; use Slim\Handlers\Strategies\RequestResponseNamedArgs; use Slim\Tests\TestCase; @@ -29,16 +28,6 @@ public function setUp(): void $this->response = $this->createMock(ResponseInterface::class); } - public function testCreatingRequestResponseNamedArgsThrowsRuntimeExceptionForPHPOlderThan80() - { - if (PHP_VERSION_ID >= self::PHP_8_0_VERSION_ID) { - $this->markTestSkipped('Test only valid for PHP versions older than 8.0'); - } - - $this->expectException(RuntimeException::class); - new RequestResponseNamedArgs(); - } - public function testCallingWithEmptyArguments() { if (PHP_VERSION_ID < self::PHP_8_0_VERSION_ID) { diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 00d3896a4..dba4db5e5 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -24,7 +24,7 @@ return connection_status(); }, - 'header' => function (string $string, bool $replace = true, int $statusCode = null): void { + 'header' => function (string $string, bool $replace = true, ?int $statusCode = null): void { HeaderStack::push( [ 'header' => $string,