Skip to content

Commit

Permalink
Rename columns for column. (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Apr 7, 2023
1 parent 4c37a2a commit 0a74d2d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/Schema/AbstractTableSchema.php
Expand Up @@ -103,9 +103,9 @@ public function primaryKey(string $value): void
$this->primaryKey[] = $value;
}

public function columns(string $index, ColumnSchemaInterface $value): void
public function column(string $name, ColumnSchemaInterface $value): void
{
$this->columns[$index] = $value;
$this->columns[$name] = $value;
}

public function getCatalogName(): string|null
Expand Down
4 changes: 2 additions & 2 deletions src/Schema/TableSchemaInterface.php
Expand Up @@ -124,9 +124,9 @@ public function primaryKey(string $value): void;
* Set one column metadata of this table. Each array element is a {@see ColumnSchemaInterface} object, indexed by
* column names.
*
* @param string $index The column name.
* @param string $name The column name.
*/
public function columns(string $index, ColumnSchemaInterface $value): void;
public function column(string $name, ColumnSchemaInterface $value): void;

/**
* @return string|null The name of the catalog (database) that this table belongs to. Defaults to null, meaning no
Expand Down
6 changes: 3 additions & 3 deletions tests/AbstractTableSchemaTest.php
Expand Up @@ -56,7 +56,7 @@ public function testGetColumn(): void

$this->assertNull($tableSchema->getColumn('id'));

$tableSchema->columns('id', $columnSchema);
$tableSchema->column('id', $columnSchema);

$this->assertSame($columnSchema, $tableSchema->getColumn('id'));
}
Expand All @@ -71,7 +71,7 @@ public function testGetColumns(): void

$this->assertSame([], $tableSchema->getColumns());

$tableSchema->columns('id', $columnSchema);
$tableSchema->column('id', $columnSchema);

$this->assertSame(['id' => $columnSchema], $tableSchema->getColumns());
}
Expand All @@ -86,7 +86,7 @@ public function testGetColumnName(): void

$this->assertNull($tableSchema->getColumn('id'));

$tableSchema->columns('id', $columnSchema);
$tableSchema->column('id', $columnSchema);

$this->assertSame(['id'], $tableSchema->getColumnNames());
}
Expand Down
10 changes: 5 additions & 5 deletions tests/Db/Schema/SchemaTest.php
Expand Up @@ -470,11 +470,11 @@ private function createTableSchemaStub(): TableSchemaInterface

// defined table T_constraints_1
$tableSchema = new TableSchema();
$tableSchema->columns('C_id', $columnCid);
$tableSchema->columns('C_not_null', $columnCNotNull);
$tableSchema->columns('C_check', $columnCCheck);
$tableSchema->columns('C_default', $columnCDefault);
$tableSchema->columns('C_unique', $columnCUnique);
$tableSchema->column('C_id', $columnCid);
$tableSchema->column('C_not_null', $columnCNotNull);
$tableSchema->column('C_check', $columnCCheck);
$tableSchema->column('C_default', $columnCDefault);
$tableSchema->column('C_unique', $columnCUnique);
$tableSchema->fullName('T_constraints_1');
$tableSchema->name('T_constraints_1');
$tableSchema->primaryKey('C_id');
Expand Down

0 comments on commit 0a74d2d

Please sign in to comment.