Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[PhpUnitBridge] Skip bootstrap for PHPUnit >=10
  • Loading branch information
HypeMC committed Jun 3, 2025
commit 36974c32de4169f96cc7e00052c79b8cf775f7ac
12 changes: 10 additions & 2 deletions src/Symfony/Bridge/PhpUnit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler;

// Detect if we need to serialize deprecations to a file.
if (in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && $file = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) {
if (
// Skip if we're using PHPUnit >=10
!class_exists(PHPUnit\Metadata\Metadata::class)
&& in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && $file = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')
) {
DeprecationErrorHandler::collectDeprecations($file);

return;
Expand Down Expand Up @@ -46,6 +50,10 @@
}
}

if ('disabled' !== getenv('SYMFONY_DEPRECATIONS_HELPER')) {
if (
// Skip if we're using PHPUnit >=10
!class_exists(PHPUnit\Metadata\Metadata::class, false)
&& 'disabled' !== getenv('SYMFONY_DEPRECATIONS_HELPER')
) {
DeprecationErrorHandler::register(getenv('SYMFONY_DEPRECATIONS_HELPER'));
}
Loading