feat(describe): more refactor

This commit is contained in:
Nuno Maduro
2023-05-26 20:01:55 +01:00
parent 68ea2c7d7e
commit 551fa01415
7 changed files with 14 additions and 32 deletions

View File

@ -58,7 +58,7 @@ final class BeforeEachCall
$describing = $this->describing;
$testCaseProxies = $this->testCaseProxies;
$beforeEachTestCall = function (TestCall $testCall) use ($describing) : void {
$beforeEachTestCall = function (TestCall $testCall) use ($describing): void {
if ($describing !== $this->describing) {
return;
}
@ -70,7 +70,7 @@ final class BeforeEachCall
$beforeEachTestCase = ChainableClosure::when(
fn (): bool => is_null($describing) || $this->__describing === $describing, // @phpstan-ignore-line
ChainableClosure::fromSameObject(fn () => $testCaseProxies->chain($this), $this->closure)->bindTo($this, self::class), // @phpstan-ignore-line
ChainableClosure::bound(fn () => $testCaseProxies->chain($this), $this->closure)->bindTo($this, self::class), // @phpstan-ignore-line
)->bindTo($this, self::class);
assert($beforeEachTestCase instanceof Closure);