From 4a88da6c26bdaad25aefc4d88ded1241f46ad0b1 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 21 Nov 2024 22:55:51 +0800 Subject: [PATCH] [11.x] Supports PHP 8.4 (#1281) * [11.x] Supports PHP 8.4 * Apply fixes from StyleCI * wip * wip --------- Co-authored-by: StyleCI Bot --- .github/workflows/tests.yml | 7 +++++-- .styleci.yml | 4 +++- composer.json | 4 ++-- src/Testing/Concerns/MakesHttpRequests.php | 8 ++++---- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ebd93595..04f12b47 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,8 +16,11 @@ jobs: strategy: fail-fast: true matrix: - php: [8.2, 8.3] + php: [8.2, 8.3, 8.4] stability: [prefer-lowest, prefer-stable] + exclude: + - php: 8.4 + stability: prefer-lowest name: PHP ${{ matrix.php }} - ${{ matrix.stability }} @@ -38,4 +41,4 @@ jobs: run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress - name: Execute tests - run: vendor/bin/phpunit + run: vendor/bin/phpunit --display-deprecations --fail-on-deprecation diff --git a/.styleci.yml b/.styleci.yml index e101e8c6..26c4f54c 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -1,5 +1,7 @@ php: preset: laravel - version: 8.1 + version: 8.2 + enabled: + - nullable_type_declarations js: true css: true diff --git a/composer.json b/composer.json index d72d762f..33dea247 100644 --- a/composer.json +++ b/composer.json @@ -54,8 +54,8 @@ "vlucas/phpdotenv": "^5.4.1" }, "require-dev": { - "mockery/mockery": "^1.4.4", - "phpunit/phpunit": "10.5.3" + "mockery/mockery": "^1.6.10", + "phpunit/phpunit": "^10.5.35" }, "suggest": { "laravel/tinker": "Required to use the tinker console command (^2.7).", diff --git a/src/Testing/Concerns/MakesHttpRequests.php b/src/Testing/Concerns/MakesHttpRequests.php index 1dd3bcae..1559e3a8 100644 --- a/src/Testing/Concerns/MakesHttpRequests.php +++ b/src/Testing/Concerns/MakesHttpRequests.php @@ -195,7 +195,7 @@ public function handle(Request $request) * @param array|null $data * @return $this */ - protected function shouldReturnJson(array $data = null) + protected function shouldReturnJson(?array $data = null) { return $this->receiveJson($data); } @@ -239,7 +239,7 @@ public function seeJsonEquals(array $data) * @param bool $negate * @return $this */ - public function seeJson(array $data = null, $negate = false) + public function seeJson(?array $data = null, $negate = false) { if (is_null($data)) { $decodedResponse = json_decode($this->response->getContent(), true); @@ -262,7 +262,7 @@ public function seeJson(array $data = null, $negate = false) * @param array|null $data * @return $this */ - public function dontSeeJson(array $data = null) + public function dontSeeJson(?array $data = null) { return $this->seeJson($data, true); } @@ -274,7 +274,7 @@ public function dontSeeJson(array $data = null) * @param array|null $responseData * @return $this */ - public function seeJsonStructure(array $structure = null, $responseData = null) + public function seeJsonStructure(?array $structure = null, $responseData = null) { $this->response->assertJsonStructure($structure, $responseData);