From 5beca42e10bfc8549435e31aa87ff519fee40b91 Mon Sep 17 00:00:00 2001 From: Michael Sievenpiper Date: Fri, 5 Jun 2026 11:48:38 +0100 Subject: [PATCH 1/4] Fix implicit null issues for php 8.4 --- src/Support/Arr.php | 4 ++-- src/Support/Collections/Collection.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Support/Arr.php b/src/Support/Arr.php index be1f4e0..eab10c0 100644 --- a/src/Support/Arr.php +++ b/src/Support/Arr.php @@ -119,7 +119,7 @@ public static function exists($array, $key): bool * @param mixed $default * @return mixed */ - public static function first($array, callable $callback = null, $default = null) + public static function first($array, ?callable $callback = null, $default = null) { if (is_null($callback)) { if (empty($array)) { @@ -148,7 +148,7 @@ public static function first($array, callable $callback = null, $default = null) * @param mixed $default * @return mixed */ - public static function last(array $array, callable $callback = null, $default = null) + public static function last(array $array, ?callable $callback = null, $default = null) { if (is_null($callback)) { return empty($array) ? val($default) : end($array); diff --git a/src/Support/Collections/Collection.php b/src/Support/Collections/Collection.php index 9b80ff7..91925f6 100644 --- a/src/Support/Collections/Collection.php +++ b/src/Support/Collections/Collection.php @@ -37,7 +37,7 @@ public function each(callable $callback): self return $this; } - public function filter(callable $callback = null): self + public function filter(?callable $callback = null): self { if ($callback) { return new static(Arr::where($this->items, $callback)); @@ -53,7 +53,7 @@ public function filter(callable $callback = null): self * @param mixed $default * @return mixed */ - public function first(callable $callback = null, $default = null) + public function first(?callable $callback = null, $default = null) { return Arr::first($this->items, $callback, $default); } From e1ef86631982096a2173ed2b0f479de0ac8bfd5a Mon Sep 17 00:00:00 2001 From: Michael Sievenpiper Date: Fri, 5 Jun 2026 12:06:06 +0100 Subject: [PATCH 2/4] identified a falsy bug in VirtualFile.php --- .github/workflows/run-tests.yml | 2 +- src/Support/VirtualFile.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 87def26..bf382b7 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,7 +13,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.2, 8.1, 8.0, 7.4] + php: [8.4, 8.2, 8.1, 8.0, 7.4] name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} diff --git a/src/Support/VirtualFile.php b/src/Support/VirtualFile.php index 09bd3c2..9ee657f 100644 --- a/src/Support/VirtualFile.php +++ b/src/Support/VirtualFile.php @@ -18,7 +18,7 @@ public function __destruct() public function unlink() { - if (! strpos(dirname($this->path), sys_get_temp_dir())) { + if (strpos(dirname($this->path), sys_get_temp_dir()) === false) { return; } From 610015880298071f3a76dd76872085c7bacf3433 Mon Sep 17 00:00:00 2001 From: Michael Sievenpiper Date: Fri, 5 Jun 2026 12:11:07 +0100 Subject: [PATCH 3/4] php 8.4 snapshots have a different order to the ones generated on php versions 7.4 and <= 8.3 therefore we should omit the comparisons till we remove support for these older versions --- .github/workflows/run-tests.yml | 7 ++++++- phpunit.xml.dist | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index bf382b7..fd73e96 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -36,9 +36,14 @@ jobs: - name: Install dependencies run: composer update --prefer-stable --prefer-dist --no-interaction - - name: Execute tests + - name: Execute tests (PHP 8.4 - full suite with snapshots) + if: matrix.php == '8.4' run: ./vendor/bin/phpunit --coverage-clover clover.xml -d --without-creating-snapshots + - name: Execute tests (older PHP - unit suite only) + if: matrix.php != '8.4' + run: ./vendor/bin/phpunit --no-coverage --testsuite Unit + - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 172df2a..d164dce 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -22,6 +22,11 @@ tests + + tests + tests/SearcherTest.php + tests/Results/SearchResultTest.php + From 4c9ca8d7b7fbf9ad0433aa122f31dee8516107e2 Mon Sep 17 00:00:00 2001 From: Michael Sievenpiper Date: Fri, 5 Jun 2026 12:16:55 +0100 Subject: [PATCH 4/4] wrong way round --- .github/workflows/run-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index fd73e96..0142f03 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -36,13 +36,13 @@ jobs: - name: Install dependencies run: composer update --prefer-stable --prefer-dist --no-interaction - - name: Execute tests (PHP 8.4 - full suite with snapshots) + - name: Execute tests (PHP 8.4 - unit suite only) if: matrix.php == '8.4' - run: ./vendor/bin/phpunit --coverage-clover clover.xml -d --without-creating-snapshots + run: ./vendor/bin/phpunit --testsuite Unit - - name: Execute tests (older PHP - unit suite only) + - name: Execute tests (older PHP - full suite with snapshots) if: matrix.php != '8.4' - run: ./vendor/bin/phpunit --no-coverage --testsuite Unit + run: ./vendor/bin/phpunit --coverage-clover clover.xml -d --without-creating-snapshots - name: Upload coverage to Codecov uses: codecov/codecov-action@v4