Skip to content

Remove irrelevant @throws annotations #5777

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

Merged
merged 2 commits into from
Oct 19, 2022
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
22 changes: 1 addition & 21 deletions src/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,6 @@ public function registerDoctrineTypeMapping(string $dbType, string $doctrineType

/**
* Gets the Doctrine type that is mapped for the given database column type.
*
* @throws Exception
*/
public function getDoctrineTypeMapping(string $dbType): string
{
Expand Down Expand Up @@ -835,8 +833,6 @@ public function getDropUniqueConstraintSQL(string $name, string $tableName): str
* on this platform.
*
* @return list<string> The list of SQL statements.
*
* @throws Exception
*/
public function getCreateTableSQL(Table $table): array
{
Expand All @@ -847,19 +843,13 @@ public function getCreateTableSQL(Table $table): array
* @internal
*
* @return list<string>
*
* @throws Exception
*/
final protected function getCreateTableWithoutForeignKeysSQL(Table $table): array
{
return $this->buildCreateTableSQL($table, false);
}

/**
* @return list<string>
*
* @throws Exception
*/
/** @return list<string> */
private function buildCreateTableSQL(Table $table, bool $createForeignKeys): array
{
if (count($table->getColumns()) === 0) {
Expand Down Expand Up @@ -958,8 +948,6 @@ private function buildCreateTableSQL(Table $table, bool $createForeignKeys): arr
* @param list<Table> $tables
*
* @return list<string>
*
* @throws Exception
*/
public function getCreateTablesSQL(array $tables): array
{
Expand Down Expand Up @@ -1102,8 +1090,6 @@ public function getCreateTemporaryTableSnippetSQL(): string
* Generates SQL statements that can be used to apply the diff.
*
* @return list<string>
*
* @throws Exception
*/
public function getAlterSchemaSQL(SchemaDiff $diff): array
{
Expand Down Expand Up @@ -1560,8 +1546,6 @@ public function getColumnDeclarationListSQL(array $columns): string
* a string that defines the complete column
*
* @return string DBMS specific SQL code portion that should be used to declare the column.
*
* @throws Exception
*/
public function getColumnDeclarationSQL(string $name, array $column): string
{
Expand Down Expand Up @@ -2233,8 +2217,6 @@ public function getTimeFormatString(): string

/**
* Adds an driver-specific LIMIT clause to the query.
*
* @throws Exception
*/
final public function modifyLimitQuery(string $query, ?int $limit, int $offset = 0): string
{
Expand Down Expand Up @@ -2401,8 +2383,6 @@ protected function getLikeWildcardCharacters(): string

/**
* Compares the definitions of the given columns in the context of this platform.
*
* @throws Exception
*/
public function columnsEqual(Column $column1, Column $column2): bool
{
Expand Down
4 changes: 2 additions & 2 deletions src/Platforms/Exception/NoColumnsSpecifiedForTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace Doctrine\DBAL\Platforms\Exception;

use Exception;
use LogicException;

use function sprintf;

/** @psalm-immutable */
final class NoColumnsSpecifiedForTable extends Exception implements PlatformException
final class NoColumnsSpecifiedForTable extends LogicException implements PlatformException
{
public static function new(string $tableName): self
{
Expand Down
9 changes: 1 addition & 8 deletions src/SQL/Builder/CreateSchemaObjectsSQLBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Doctrine\DBAL\SQL\Builder;

use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\Sequence;
Expand All @@ -18,11 +17,7 @@ public function __construct(private readonly AbstractPlatform $platform)
{
}

/**
* @return list<string>
*
* @throws Exception
*/
/** @return list<string> */
public function buildSQL(Schema $schema): array
{
return array_merge(
Expand Down Expand Up @@ -54,8 +49,6 @@ private function buildNamespaceStatements(array $namespaces): array
* @param list<Table> $tables
*
* @return list<string>
*
* @throws Exception
*/
private function buildTableStatements(array $tables): array
{
Expand Down
9 changes: 0 additions & 9 deletions src/Schema/Comparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Doctrine\DBAL\Schema;

use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Platforms\AbstractPlatform;

use function array_map;
Expand All @@ -24,8 +23,6 @@ public function __construct(private readonly AbstractPlatform $platform)

/**
* Returns the differences between the schemas.
*
* @throws Exception
*/
public function compareSchemas(Schema $oldSchema, Schema $newSchema): SchemaDiff
{
Expand Down Expand Up @@ -143,8 +140,6 @@ public function diffSequence(Sequence $sequence1, Sequence $sequence2): bool

/**
* Compares the tables and returns the difference between them.
*
* @throws Exception
*/
public function compareTables(Table $oldTable, Table $newTable): TableDiff
{
Expand Down Expand Up @@ -280,8 +275,6 @@ public function compareTables(Table $oldTable, Table $newTable): TableDiff
* @param array<string,Column> $removedColumns
*
* @return array<string,Column>
*
* @throws Exception
*/
private function detectRenamedColumns(array &$addedColumns, array &$removedColumns): array
{
Expand Down Expand Up @@ -405,8 +398,6 @@ protected function diffForeignKey(ForeignKeyConstraint $key1, ForeignKeyConstrai

/**
* Compares the definitions of the given columns
*
* @throws Exception
*/
protected function columnsEqual(Column $column1, Column $column2): bool
{
Expand Down