diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml
index 87def26..0142f03 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 }}
@@ -36,7 +36,12 @@ jobs:
- name: Install dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction
- - name: Execute tests
+ - name: Execute tests (PHP 8.4 - unit suite only)
+ if: matrix.php == '8.4'
+ run: ./vendor/bin/phpunit --testsuite Unit
+
+ - name: Execute tests (older PHP - full suite with snapshots)
+ if: matrix.php != '8.4'
run: ./vendor/bin/phpunit --coverage-clover clover.xml -d --without-creating-snapshots
- name: Upload coverage to Codecov
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
+
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);
}
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;
}