Skip to content

Commit d14fc1e

Browse files
Rename ColumnSchemaBuilder::class to AbstractColumnSchemaBuilder::class. (#215)
* Rename ColumnSchemaBuilder::class to AbstractColumnSchemaBuilder::class.
1 parent 67af7f0 commit d14fc1e

3 files changed

Lines changed: 18 additions & 17 deletions

File tree

src/ColumnSchemaBuilder.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Yiisoft\Db\Pgsql;
6+
7+
use Yiisoft\Db\Schema\AbstractColumnSchemaBuilder;
8+
9+
final class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
10+
{
11+
}

src/DDLQueryBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Yiisoft\Db\Exception\NotSupportedException;
1111
use Yiisoft\Db\QueryBuilder\AbstractDDLQueryBuilder;
1212
use Yiisoft\Db\QueryBuilder\QueryBuilderInterface;
13-
use Yiisoft\Db\Schema\ColumnSchemaBuilder;
13+
use Yiisoft\Db\Schema\ColumnSchemaBuilderInterface;
1414
use Yiisoft\Db\Schema\QuoterInterface;
1515
use Yiisoft\Db\Schema\SchemaInterface;
1616

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

43-
public function alterColumn(string $table, string $column, ColumnSchemaBuilder|string $type): string
43+
public function alterColumn(string $table, string $column, ColumnSchemaBuilderInterface|string $type): string
4444
{
4545
$columnName = $this->quoter->quoteColumnName($column);
4646
$tableName = $this->quoter->quoteTableName($table);

src/Schema.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Yiisoft\Db\Exception\NotSupportedException;
1818
use Yiisoft\Db\Expression\Expression;
1919
use Yiisoft\Db\Schema\AbstractSchema;
20-
use Yiisoft\Db\Schema\ColumnSchemaBuilder;
20+
use Yiisoft\Db\Schema\ColumnSchemaBuilderInterface;
2121
use Yiisoft\Db\Schema\ColumnSchemaInterface;
2222
use Yiisoft\Db\Schema\TableSchemaInterface;
2323

@@ -1040,20 +1040,10 @@ private function createColumnSchema(): ColumnSchema
10401040
return new ColumnSchema();
10411041
}
10421042

1043-
/**
1044-
* Create a column schema builder instance giving the type and value precision.
1045-
*
1046-
* This method may be overridden by child classes to create a DBMS-specific column schema builder.
1047-
*
1048-
* @param string $type type of the column. See {@see ColumnSchemaBuilder::$type}.
1049-
* @param array|int|string|null $length length or precision of the column. See {@see ColumnSchemaBuilder::$length}.
1050-
*
1051-
* @return ColumnSchemaBuilder column schema builder instance
1052-
*
1053-
* @psalm-param string[]|int[]|int|string|null $length
1054-
*/
1055-
public function createColumnSchemaBuilder(string $type, int|string|array|null $length = null): ColumnSchemaBuilder
1056-
{
1043+
public function createColumnSchemaBuilder(
1044+
string $type,
1045+
int|string|array|null $length = null
1046+
): ColumnSchemaBuilderInterface {
10571047
return new ColumnSchemaBuilder($type, $length);
10581048
}
10591049

0 commit comments

Comments
 (0)