Skip to content

Commit d36f402

Browse files
committed
Remove references to DBALException
1 parent 078cf7c commit d36f402

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

Messenger/DoctrinePingConnectionMiddleware.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Messenger;
1313

14-
use Doctrine\DBAL\DBALException;
15-
use Doctrine\DBAL\Exception;
14+
use Doctrine\DBAL\Exception as DBALException;
1615
use Doctrine\ORM\EntityManagerInterface;
1716
use Symfony\Component\Messenger\Envelope;
1817
use Symfony\Component\Messenger\Middleware\StackInterface;
@@ -40,7 +39,7 @@ private function pingConnection(EntityManagerInterface $entityManager)
4039

4140
try {
4241
$connection->executeQuery($connection->getDatabasePlatform()->getDummySelectSQL());
43-
} catch (DBALException | Exception $e) {
42+
} catch (DBALException $e) {
4443
$connection->close();
4544
$connection->connect();
4645
}

Tests/Messenger/DoctrinePingConnectionMiddlewareTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
namespace Symfony\Bridge\Doctrine\Tests\Messenger;
1313

1414
use Doctrine\DBAL\Connection;
15-
use Doctrine\DBAL\DBALException;
16-
use Doctrine\DBAL\Exception;
15+
use Doctrine\DBAL\Exception as DBALException;
1716
use Doctrine\ORM\EntityManagerInterface;
1817
use Doctrine\Persistence\ManagerRegistry;
1918
use Symfony\Bridge\Doctrine\Messenger\DoctrinePingConnectionMiddleware;
@@ -50,7 +49,7 @@ public function testMiddlewarePingOk()
5049
{
5150
$this->connection->expects($this->once())
5251
->method('getDatabasePlatform')
53-
->will($this->throwException(class_exists(Exception::class) ? new Exception() : new DBALException()));
52+
->will($this->throwException(new DBALException()));
5453

5554
$this->connection->expects($this->once())
5655
->method('close')
@@ -69,7 +68,7 @@ public function testMiddlewarePingResetEntityManager()
6968
{
7069
$this->connection->expects($this->once())
7170
->method('getDatabasePlatform')
72-
->will($this->throwException(class_exists(Exception::class) ? new Exception() : new DBALException()));
71+
->will($this->throwException(new DBALException()));
7372

7473
$this->entityManager->expects($this->once())
7574
->method('isOpen')

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
"doctrine/annotations": "^1.10.4",
4848
"doctrine/collections": "~1.0",
4949
"doctrine/data-fixtures": "^1.1",
50-
"doctrine/dbal": "^2.10|^3.0",
50+
"doctrine/dbal": "^2.13|^3.0",
5151
"doctrine/orm": "^2.7.3"
5252
},
5353
"conflict": {
54-
"doctrine/dbal": "<2.10",
54+
"doctrine/dbal": "<2.13",
5555
"doctrine/orm": "<2.7.3",
5656
"phpunit/phpunit": "<5.4.3",
5757
"symfony/dependency-injection": "<4.4",

0 commit comments

Comments
 (0)