init
This commit is contained in:
32
backend/vendor/doctrine/doctrine-bundle/src/Middleware/DebugMiddleware.php
vendored
Normal file
32
backend/vendor/doctrine/doctrine-bundle/src/Middleware/DebugMiddleware.php
vendored
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user