diff --git a/src/Command/AbstractCommand.php b/src/Command/AbstractCommand.php index b2036c2f2..479c1052e 100644 --- a/src/Command/AbstractCommand.php +++ b/src/Command/AbstractCommand.php @@ -189,7 +189,7 @@ public function addUnique(string $table, string $name, array|string $columns): s return $this->setSql($sql)->requireTableSchemaRefresh($table); } - public function alterColumn(string $table, string $column, string|ColumnInterface $type): static + public function alterColumn(string $table, string $column, ColumnInterface|string $type): static { $sql = $this->getQueryBuilder()->alterColumn($table, $column, $type); return $this->setSql($sql)->requireTableSchemaRefresh($table); diff --git a/src/Command/CommandInterface.php b/src/Command/CommandInterface.php index 59ddcb890..955e28c3b 100644 --- a/src/Command/CommandInterface.php +++ b/src/Command/CommandInterface.php @@ -145,7 +145,7 @@ public function addPrimaryKey(string $table, string $name, array|string $columns * * Note: The method will quote the `table` and `column` parameters before using them in the generated SQL. */ - public function alterColumn(string $table, string $column, string|ColumnInterface $type): static; + public function alterColumn(string $table, string $column, ColumnInterface|string $type): static; /** * Creates a batch INSERT command. diff --git a/src/Debug/CommandInterfaceProxy.php b/src/Debug/CommandInterfaceProxy.php index ebbccdd00..2ca7773c7 100644 --- a/src/Debug/CommandInterfaceProxy.php +++ b/src/Debug/CommandInterfaceProxy.php @@ -9,6 +9,7 @@ use Yiisoft\Db\Command\CommandInterface; use Yiisoft\Db\Query\Data\DataReaderInterface; use Yiisoft\Db\Query\QueryInterface; +use Yiisoft\Db\Schema\Builder\ColumnInterface; final class CommandInterfaceProxy implements CommandInterface { @@ -92,7 +93,7 @@ public function addUnique(string $table, string $name, array|string $columns): s /** * @psalm-suppress MixedArgument */ - public function alterColumn(string $table, string $column, string $type): static + public function alterColumn(string $table, string $column, ColumnInterface|string $type): static { return new self($this->decorated->{__FUNCTION__}(...func_get_args()), $this->collector); }