Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax return types of getExceptionConverter() implementations #6221

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Driver/AbstractDB2Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Doctrine\DBAL\Driver;

use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\API\ExceptionConverter as ExceptionConverterInterface;
use Doctrine\DBAL\Driver\API\IBMDB2\ExceptionConverter;
use Doctrine\DBAL\Platforms\DB2Platform;
use Doctrine\DBAL\ServerVersionProvider;
Expand All @@ -19,7 +20,7 @@ public function getDatabasePlatform(ServerVersionProvider $versionProvider): DB2
return new DB2Platform();
}

public function getExceptionConverter(): ExceptionConverter
public function getExceptionConverter(): ExceptionConverterInterface
{
return new ExceptionConverter();
}
Expand Down
3 changes: 2 additions & 1 deletion src/Driver/AbstractMySQLDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Doctrine\DBAL\Driver;

use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\API\ExceptionConverter as ExceptionConverterInterface;
use Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter;
use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
use Doctrine\DBAL\Platforms\Exception\InvalidPlatformVersion;
Expand Down Expand Up @@ -52,7 +53,7 @@ public function getDatabasePlatform(ServerVersionProvider $versionProvider): Abs
return new MySQLPlatform();
}

public function getExceptionConverter(): ExceptionConverter
public function getExceptionConverter(): ExceptionConverterInterface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one was not narrowed in #4926, it's just as narrow on 3.x… I think it's fine not to document that change as breaking since ExceptionConverter is internal.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the type is wider on 3.x.

public function getExceptionConverter(): ExceptionConverter
{
return new MySQL\ExceptionConverter();
}

I'm restoring the 3.x return type declaration.

{
return new ExceptionConverter();
}
Expand Down
3 changes: 2 additions & 1 deletion src/Driver/AbstractOracleDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\AbstractOracleDriver\EasyConnectString;
use Doctrine\DBAL\Driver\API\ExceptionConverter as ExceptionConverterInterface;
use Doctrine\DBAL\Driver\API\OCI\ExceptionConverter;
use Doctrine\DBAL\Platforms\OraclePlatform;
use Doctrine\DBAL\ServerVersionProvider;
Expand All @@ -20,7 +21,7 @@ public function getDatabasePlatform(ServerVersionProvider $versionProvider): Ora
return new OraclePlatform();
}

public function getExceptionConverter(): ExceptionConverter
public function getExceptionConverter(): ExceptionConverterInterface
{
return new ExceptionConverter();
}
Expand Down
3 changes: 2 additions & 1 deletion src/Driver/AbstractPostgreSQLDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Doctrine\DBAL\Driver;

use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\API\ExceptionConverter as ExceptionConverterInterface;
use Doctrine\DBAL\Driver\API\PostgreSQL\ExceptionConverter;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\ServerVersionProvider;
Expand All @@ -19,7 +20,7 @@ public function getDatabasePlatform(ServerVersionProvider $versionProvider): Pos
return new PostgreSQLPlatform();
}

public function getExceptionConverter(): ExceptionConverter
public function getExceptionConverter(): ExceptionConverterInterface
{
return new ExceptionConverter();
}
Expand Down
3 changes: 2 additions & 1 deletion src/Driver/AbstractSQLServerDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Doctrine\DBAL\Driver;

use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\API\ExceptionConverter as ExceptionConverterInterface;
use Doctrine\DBAL\Driver\API\SQLSrv\ExceptionConverter;
use Doctrine\DBAL\Platforms\SQLServerPlatform;
use Doctrine\DBAL\ServerVersionProvider;
Expand All @@ -19,7 +20,7 @@ public function getDatabasePlatform(ServerVersionProvider $versionProvider): SQL
return new SQLServerPlatform();
}

public function getExceptionConverter(): ExceptionConverter
public function getExceptionConverter(): ExceptionConverterInterface
{
return new ExceptionConverter();
}
Expand Down
3 changes: 2 additions & 1 deletion src/Driver/AbstractSQLiteDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Doctrine\DBAL\Driver;

use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\API\ExceptionConverter as ExceptionConverterInterface;
use Doctrine\DBAL\Driver\API\SQLite\ExceptionConverter;
use Doctrine\DBAL\Platforms\SQLitePlatform;
use Doctrine\DBAL\ServerVersionProvider;
Expand All @@ -19,7 +20,7 @@ public function getDatabasePlatform(ServerVersionProvider $versionProvider): SQL
return new SQLitePlatform();
}

public function getExceptionConverter(): ExceptionConverter
public function getExceptionConverter(): ExceptionConverterInterface
{
return new ExceptionConverter();
}
Expand Down