From 0ccbe5c8f0b886d3af5864ed3adb263f50984e0a Mon Sep 17 00:00:00 2001 From: Peter Fox Date: Sun, 17 Mar 2024 17:23:17 +0000 Subject: [PATCH] Remove Laravel serialisable closure --- composer.json | 1 - src/Factories/TestCaseFactory.php | 3 +-- tests/Arch.php | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 7fec7cf4..db105652 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,6 @@ "require": { "php": "^8.1.0", "brianium/paratest": "^7.3.1", - "laravel/serializable-closure": "^1.0", "nunomaduro/collision": "^7.10.0|^8.1.1", "nunomaduro/termwind": "^1.15.1|^2.0.1", "pestphp/pest-plugin": "^2.1.1", diff --git a/src/Factories/TestCaseFactory.php b/src/Factories/TestCaseFactory.php index 8d91f986..73ba8321 100644 --- a/src/Factories/TestCaseFactory.php +++ b/src/Factories/TestCaseFactory.php @@ -4,7 +4,6 @@ declare(strict_types=1); namespace Pest\Factories; -use Laravel\SerializableClosure\Support\ReflectionClosure; use ParseError; use Pest\Concerns; use Pest\Contracts\AddsAnnotations; @@ -220,7 +219,7 @@ final class TestCaseFactory if ( $method->closure instanceof \Closure && - (new ReflectionClosure($method->closure))->isStatic() + (new \ReflectionFunction($method->closure))->isStatic() ) { throw new TestClosureMustNotBeStatic("The test `$method->description` closure must not be static in $method->filename."); } diff --git a/tests/Arch.php b/tests/Arch.php index d9bcea4c..7c508cf2 100644 --- a/tests/Arch.php +++ b/tests/Arch.php @@ -22,7 +22,6 @@ arch('dependencies') 'Whoops', 'Symfony\Component\Console', 'Symfony\Component\Process', - 'Laravel\SerializableClosure\Support\ReflectionClosure', ])->ignoring(['Composer', 'PHPUnit', 'SebastianBergmann']); arch('contracts')