This commit is contained in:
Marek
2026-03-24 00:04:55 +01:00
commit c5229e48ed
4225 changed files with 511461 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace Doctrine\Bundle\DoctrineBundle\Middleware;
use Doctrine\DBAL\Driver as DriverInterface;
use Doctrine\DBAL\Driver\Middleware;
use Symfony\Bridge\Doctrine\Middleware\Debug\DebugDataHolder;
use Symfony\Bridge\Doctrine\Middleware\Debug\Driver;
use Symfony\Component\Stopwatch\Stopwatch;
class DebugMiddleware implements Middleware, ConnectionNameAwareInterface
{
private string $connectionName = 'default';
public function __construct(
private readonly DebugDataHolder $debugDataHolder,
private readonly Stopwatch|null $stopwatch,
) {
}
public function setConnectionName(string $name): void
{
$this->connectionName = $name;
}
public function wrap(DriverInterface $driver): DriverInterface
{
return new Driver($driver, $this->debugDataHolder, $this->stopwatch, $this->connectionName);
}
}