Skip to content

Commit

Permalink
Declare NoColumnsSpecifiedForTable as a LogicException
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Oct 19, 2022
1 parent deb739f commit 639c058
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 27 deletions.
18 changes: 1 addition & 17 deletions src/Platforms/AbstractPlatform.php
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 @@ -2231,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
4 changes: 2 additions & 2 deletions src/Platforms/Exception/NoColumnsSpecifiedForTable.php
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
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

0 comments on commit 639c058

Please sign in to comment.