From 727823a41a5520ef6219ce2602caa23bad6c2fff Mon Sep 17 00:00:00 2001 From: Dieter Beck Date: Thu, 11 Jul 2024 07:40:05 +0200 Subject: [PATCH] Test against PHP 8.2 + 8.3 (#101) * Test against PHP 8.2 + 8.3 * Define nullable parameter types explicitly * Drop support for PHP 8.0 --- .github/workflows/main.yml | 2 +- composer.json | 2 +- src/Codeception/Module/REST.php | 4 ++-- src/Codeception/Step/AsJson.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9b70642..254cd22 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: - php: [8.0, 8.1] + php: [8.1, 8.2, 8.3] steps: - name: Checkout code diff --git a/composer.json b/composer.json index f96f33a..d02a361 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ ], "homepage": "https://codeception.com/", "require": { - "php": "^8.0", + "php": "^8.1", "ext-dom": "*", "ext-json": "*", "codeception/codeception": "^5.0.8", diff --git a/src/Codeception/Module/REST.php b/src/Codeception/Module/REST.php index d5e78b9..d75b464 100644 --- a/src/Codeception/Module/REST.php +++ b/src/Codeception/Module/REST.php @@ -1330,7 +1330,7 @@ public function dontSeeResponseContainsJson(array $json = []): void * @part json * @see JsonType */ - public function seeResponseMatchesJsonType(array $jsonType, string $jsonPath = null): void + public function seeResponseMatchesJsonType(array $jsonType, ?string $jsonPath = null): void { $jsonArray = new JsonArray($this->connectionModule->_getResponseContent()); if ($jsonPath) { @@ -1347,7 +1347,7 @@ public function seeResponseMatchesJsonType(array $jsonType, string $jsonPath = n * @param array $jsonType JsonType structure * @see seeResponseMatchesJsonType */ - public function dontSeeResponseMatchesJsonType(array $jsonType, string $jsonPath = null): void + public function dontSeeResponseMatchesJsonType(array $jsonType, ?string $jsonPath = null): void { $jsonArray = new JsonArray($this->connectionModule->_getResponseContent()); if ($jsonPath) { diff --git a/src/Codeception/Step/AsJson.php b/src/Codeception/Step/AsJson.php index 78acdf2..636a662 100644 --- a/src/Codeception/Step/AsJson.php +++ b/src/Codeception/Step/AsJson.php @@ -7,7 +7,7 @@ class AsJson extends Action implements GeneratedStep { - public function run(ModuleContainer $container = null) + public function run(?ModuleContainer $container = null) { $container->getModule('REST')->haveHttpHeader('Content-Type', 'application/json'); $resp = parent::run($container);