Skip to content

Commit

Permalink
feat(o10r-symfony-template-154): Upgrade doctrine/orm to 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiidonii committed Jun 4, 2024
1 parent cb6eab1 commit 03535bd
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions src/Doctrine/Driver/IamDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -46,7 +47,7 @@ public function connect(array $params): DriverConnection
"$host:$port",
$this->region,
$user,
true
true,
);

return $this->subject->connect($params);
Expand All @@ -56,29 +57,32 @@ 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
{
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<PostgreSQLPlatform>
*/
public function getSchemaManager(Connection $conn, AbstractPlatform $platform): AbstractSchemaManager
{
return $this->subject->getSchemaManager($conn, $platform);
}
}

0 comments on commit 03535bd

Please sign in to comment.