Skip to content

Commit

Permalink
cleanup for StaticDriver class (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaicher authored Aug 11, 2023
1 parent 8b0991d commit 74a6078
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions src/DAMA/DoctrineTestBundle/Doctrine/DBAL/StaticDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,12 @@ class StaticDriver extends Driver\Middleware\AbstractDriverMiddleware
/**
* @var Connection[]
*/
protected static $connections = [];
private static $connections = [];

/**
* @var bool
*/
protected static $keepStaticConnections = false;

/**
* @var Driver
*/
protected $underlyingDriver;

public function __construct(Driver $underlyingDriver)
{
$this->underlyingDriver = $underlyingDriver;
parent::__construct($underlyingDriver);
}
private static $keepStaticConnections = false;

public function connect(array $params): DriverConnection
{
Expand Down Expand Up @@ -70,22 +59,22 @@ public static function isKeepStaticConnections(): bool

public static function beginTransaction(): void
{
foreach (self::$connections as $con) {
$con->beginTransaction();
foreach (self::$connections as $connection) {
$connection->beginTransaction();
}
}

public static function rollBack(): void
{
foreach (self::$connections as $con) {
$con->rollBack();
foreach (self::$connections as $connection) {
$connection->rollBack();
}
}

public static function commit(): void
{
foreach (self::$connections as $con) {
$con->commit();
foreach (self::$connections as $connection) {
$connection->commit();
}
}
}

0 comments on commit 74a6078

Please sign in to comment.