Skip to content

Commit

Permalink
bot: fix cs [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
nikophil authored and kbond committed Apr 3, 2024
1 parent 7cfab99 commit cf400d0
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/Test/KernelHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

declare(strict_types=1);

/*
* This file is part of the zenstruck/foundry package.
*
* (c) Kevin Bond <kevinbond@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Zenstruck\Foundry\Test;

use Symfony\Component\HttpKernel\KernelInterface;
Expand All @@ -25,13 +34,13 @@ public static function shutdownKernel(KernelInterface $kernel): void
$kernel->shutdown();

while (true) {
$previousHandler = set_error_handler(static fn() => null);
restore_error_handler();
$isPhpUnitErrorHandler = ($previousHandler instanceof \PHPUnit\Runner\ErrorHandler);
if ($previousHandler === null || $isPhpUnitErrorHandler) {
$previousHandler = \set_error_handler(static fn() => null);
\restore_error_handler();
$isPhpUnitErrorHandler = $previousHandler instanceof \PHPUnit\Runner\ErrorHandler;
if (null === $previousHandler || $isPhpUnitErrorHandler) {
break;
}
restore_error_handler();
\restore_error_handler();
}
}
}

0 comments on commit cf400d0

Please sign in to comment.