Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
<testsuite name="Permafrost Test Suite">
<directory>tests</directory>
</testsuite>
<testsuite name="Unit">
<directory>tests</directory>
<exclude>tests/SearcherTest.php</exclude>
<exclude>tests/Results/SearchResultTest.php</exclude>
</testsuite>
</testsuites>
<coverage>
<include>
Expand Down
4 changes: 2 additions & 2 deletions src/Support/Arr.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Support/Collections/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Support/VirtualFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Loading