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

@ -28,7 +28,7 @@ final class AfterEachRepository
if (array_key_exists($filename, $this->state)) {
$fromAfterEachTestCase = $this->state[$filename];
$afterEachTestCase = ChainableClosure::fromSameObject($fromAfterEachTestCase, $afterEachTestCase)
$afterEachTestCase = ChainableClosure::bound($fromAfterEachTestCase, $afterEachTestCase)
->bindTo($afterEachCall, $afterEachCall::class);
}
@ -44,7 +44,7 @@ final class AfterEachRepository
{
$afterEach = $this->state[$filename] ?? NullClosure::create();
return ChainableClosure::fromSameObject(function (): void {
return ChainableClosure::bound(function (): void {
if (class_exists(Mockery::class)) {
if ($container = Mockery::getContainer()) {
/* @phpstan-ignore-next-line */