From 88675b4f0d799f34133cbb5d1c37a2ceb26e40e8 Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Fri, 22 Nov 2024 15:05:17 +0100 Subject: [PATCH] feat: add Tests for PHP 8.4, fix deprecations for PHP 8.4 --- .github/workflows/build.yml | 8 ++++---- src/CasesCollection.php | 4 ++-- src/Concerns/CollectsCases.php | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 316c572..777738d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - php: [8.1, 8.2, 8.3] + php: [8.1, 8.2, 8.3, 8.4] dependency-version: [prefer-stable] os: [ubuntu-latest] @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -42,7 +42,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -71,7 +71,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/src/CasesCollection.php b/src/CasesCollection.php index 6d8e17c..c74686c 100644 --- a/src/CasesCollection.php +++ b/src/CasesCollection.php @@ -115,7 +115,7 @@ public function toArray(): array * @param (callable(TValue, array-key): bool)|null $callback * @return ?TValue */ - public function first(callable $callback = null): mixed + public function first(callable|null $callback = null): mixed { $callback ??= fn() => true; @@ -159,7 +159,7 @@ public function values(): array * @param (callable(TValue): array-key)|string|null $key * @return array */ - public function pluck(callable|string $value, callable|string $key = null): array + public function pluck(callable|string $value, callable|string|null $key = null): array { $result = []; diff --git a/src/Concerns/CollectsCases.php b/src/Concerns/CollectsCases.php index 2be87dd..8e1e9aa 100644 --- a/src/Concerns/CollectsCases.php +++ b/src/Concerns/CollectsCases.php @@ -32,7 +32,7 @@ public static function count(): int * * @param (callable(self, array-key): bool)|null $callback */ - public static function first(callable $callback = null): ?self + public static function first(callable|null $callback = null): ?self { return self::collect()->first($callback); } @@ -66,7 +66,7 @@ public static function values(): array * @param (callable(self): array-key)|string|null $key * @return array */ - public static function pluck(callable|string $value, callable|string $key = null): array + public static function pluck(callable|string $value, callable|string|null $key = null): array { return self::collect()->pluck($value, $key); }