File tree 2 files changed +16
-7
lines changed
2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public static function _resetDatabase(): void
36
36
37
37
PersistenceManager::resetDatabase (
38
38
static fn () => static ::bootKernel (),
39
- static function (): void {
39
+ static function (): void {
40
40
static ::ensureKernelShutdown ();
41
41
restorePhpUnitErrorHandler ();
42
42
},
@@ -56,7 +56,7 @@ public static function _resetSchema(): void
56
56
57
57
PersistenceManager::resetSchema (
58
58
static fn () => static ::bootKernel (),
59
- static function (): void {
59
+ static function (): void {
60
60
static ::ensureKernelShutdown ();
61
61
restorePhpUnitErrorHandler ();
62
62
},
Original file line number Diff line number Diff line change 2
2
3
3
declare (strict_types=1 );
4
4
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
+
5
14
namespace Zenstruck \Foundry ;
6
15
7
16
/**
18
27
function restorePhpUnitErrorHandler (): void
19
28
{
20
29
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 ) {
25
34
break ;
26
35
}
27
- restore_error_handler ();
36
+ \ restore_error_handler ();
28
37
}
29
38
}
You can’t perform that action at this time.
0 commit comments