Skip to content

Commit

Permalink
Rename ColumnSchemaBuilder::class to AbstractColumnSchemaBuilder::cla…
Browse files Browse the repository at this point in the history
…ss. (#215)

* Rename ColumnSchemaBuilder::class to AbstractColumnSchemaBuilder::class.
  • Loading branch information
terabytesoftw committed Jan 12, 2023
1 parent 67af7f0 commit d14fc1e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
11 changes: 11 additions & 0 deletions src/ColumnSchemaBuilder.php
@@ -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
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
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

0 comments on commit d14fc1e

Please sign in to comment.