Skip to content

Commit 71bbaa2

Browse files
nikophilkbond
authored andcommitted
bot: fix cs [skip ci]
1 parent 9174dc6 commit 71bbaa2

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

src/Test/ResetDatabase.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static function _resetDatabase(): void
3636

3737
PersistenceManager::resetDatabase(
3838
static fn() => static::bootKernel(),
39-
static function (): void {
39+
static function(): void {
4040
static::ensureKernelShutdown();
4141
restorePhpUnitErrorHandler();
4242
},
@@ -56,7 +56,7 @@ public static function _resetSchema(): void
5656

5757
PersistenceManager::resetSchema(
5858
static fn() => static::bootKernel(),
59-
static function (): void {
59+
static function(): void {
6060
static::ensureKernelShutdown();
6161
restorePhpUnitErrorHandler();
6262
},

src/phpunit_helper.php

+14-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the zenstruck/foundry package.
7+
*
8+
* (c) Kevin Bond <[email protected]>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
514
namespace Zenstruck\Foundry;
615

716
/**
@@ -18,12 +27,12 @@
1827
function restorePhpUnitErrorHandler(): void
1928
{
2029
while (true) {
21-
$previousHandler = set_error_handler(static fn() => null); // @phpstan-ignore-line
22-
restore_error_handler();
23-
$isPhpUnitErrorHandler = ($previousHandler instanceof \PHPUnit\Runner\ErrorHandler); // @phpstan-ignore-line
24-
if ($previousHandler === null || $isPhpUnitErrorHandler) {
30+
$previousHandler = \set_error_handler(static fn() => null); // @phpstan-ignore-line
31+
\restore_error_handler();
32+
$isPhpUnitErrorHandler = $previousHandler instanceof \PHPUnit\Runner\ErrorHandler; // @phpstan-ignore-line
33+
if (null === $previousHandler || $isPhpUnitErrorHandler) {
2534
break;
2635
}
27-
restore_error_handler();
36+
\restore_error_handler();
2837
}
2938
}

0 commit comments

Comments
 (0)