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

Rename ColumnSchemaBuilder::class to AbstractColumnSchemaBuilder::class. #215

Merged
merged 2 commits into from
Jan 12, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/ColumnSchemaBuilder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace Yiisoft\Db\Pgsql;

use Yiisoft\Db\Schema\AbstractColumnSchemaBuilder;

final class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
{
}
4 changes: 2 additions & 2 deletions src/DDLQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Yiisoft\Db\Exception\NotSupportedException;
use Yiisoft\Db\QueryBuilder\AbstractDDLQueryBuilder;
use Yiisoft\Db\QueryBuilder\QueryBuilderInterface;
use Yiisoft\Db\Schema\ColumnSchemaBuilder;
use Yiisoft\Db\Schema\ColumnSchemaBuilderInterface;
use Yiisoft\Db\Schema\QuoterInterface;
use Yiisoft\Db\Schema\SchemaInterface;

Expand Down Expand Up @@ -40,7 +40,7 @@ public function addDefaultValue(string $name, string $table, string $column, mix
throw new NotSupportedException(__METHOD__ . ' is not supported by PostgreSQL.');
}

public function alterColumn(string $table, string $column, ColumnSchemaBuilder|string $type): string
public function alterColumn(string $table, string $column, ColumnSchemaBuilderInterface|string $type): string
{
$columnName = $this->quoter->quoteColumnName($column);
$tableName = $this->quoter->quoteTableName($table);
Expand Down
20 changes: 5 additions & 15 deletions src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Yiisoft\Db\Exception\NotSupportedException;
use Yiisoft\Db\Expression\Expression;
use Yiisoft\Db\Schema\AbstractSchema;
use Yiisoft\Db\Schema\ColumnSchemaBuilder;
use Yiisoft\Db\Schema\ColumnSchemaBuilderInterface;
use Yiisoft\Db\Schema\ColumnSchemaInterface;
use Yiisoft\Db\Schema\TableSchemaInterface;

Expand Down Expand Up @@ -1040,20 +1040,10 @@ private function createColumnSchema(): ColumnSchema
return new ColumnSchema();
}

/**
* Create a column schema builder instance giving the type and value precision.
*
* This method may be overridden by child classes to create a DBMS-specific column schema builder.
*
* @param string $type type of the column. See {@see ColumnSchemaBuilder::$type}.
* @param array|int|string|null $length length or precision of the column. See {@see ColumnSchemaBuilder::$length}.
*
* @return ColumnSchemaBuilder column schema builder instance
*
* @psalm-param string[]|int[]|int|string|null $length
*/
public function createColumnSchemaBuilder(string $type, int|string|array|null $length = null): ColumnSchemaBuilder
{
public function createColumnSchemaBuilder(
string $type,
int|string|array|null $length = null
): ColumnSchemaBuilderInterface {
return new ColumnSchemaBuilder($type, $length);
}

Expand Down