From 03535bdbd0a50fd1031f16b8cdf33b6072b8c804 Mon Sep 17 00:00:00 2001 From: Serhii Donii Date: Tue, 4 Jun 2024 17:12:06 +0300 Subject: [PATCH] feat(o10r-symfony-template-154): Upgrade doctrine/orm to 3.0 --- src/Doctrine/Driver/IamDecorator.php | 34 ++++++++++++++++------------ 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/Doctrine/Driver/IamDecorator.php b/src/Doctrine/Driver/IamDecorator.php index 1a6434f..0066db3 100644 --- a/src/Doctrine/Driver/IamDecorator.php +++ b/src/Doctrine/Driver/IamDecorator.php @@ -6,11 +6,12 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Driver; -use Doctrine\DBAL\Driver\Exception as DriverException; use Doctrine\DBAL\Driver\API\ExceptionConverter; use Doctrine\DBAL\Driver\Connection as DriverConnection; +use Doctrine\DBAL\Driver\Exception as DriverException; use Doctrine\DBAL\Exception\ConnectionException; use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\AbstractSchemaManager; use Macpaw\DoctrineAwsIamRdsAuthBundle\Aws\Token\TokenProviderInterface; @@ -46,7 +47,7 @@ public function connect(array $params): DriverConnection "$host:$port", $this->region, $user, - true + true, ); return $this->subject->connect($params); @@ -56,14 +57,15 @@ public function connect(array $params): DriverConnection } } - public function getDatabasePlatform(): AbstractPlatform + private function isConnectionException(\Throwable $e): bool { - return $this->subject->getDatabasePlatform(); - } + if ($e instanceof DriverException) { + $driverException = $this->getExceptionConverter()->convert($e, null); - public function getSchemaManager(Connection $conn, AbstractPlatform $platform): AbstractSchemaManager - { - return $this->subject->getSchemaManager($conn, $platform); + return $driverException instanceof ConnectionException; + } + + return false; } public function getExceptionConverter(): ExceptionConverter @@ -71,14 +73,16 @@ public function getExceptionConverter(): ExceptionConverter return $this->subject->getExceptionConverter(); } - private function isConnectionException(\Throwable $e): bool + public function getDatabasePlatform(): AbstractPlatform { - if ($e instanceof DriverException) { - $driverException = $this->getExceptionConverter()->convert($e, null); - - return $driverException instanceof ConnectionException; - } + return $this->subject->getDatabasePlatform(); + } - return false; + /** + * @return AbstractSchemaManager + */ + public function getSchemaManager(Connection $conn, AbstractPlatform $platform): AbstractSchemaManager + { + return $this->subject->getSchemaManager($conn, $platform); } }