Skip to content

Commit

Permalink
Static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofandel committed Jan 26, 2024
1 parent d34fafb commit 948b8ca
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 33 deletions.
29 changes: 2 additions & 27 deletions tests/Platforms/AbstractPlatformTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ public function testAlterTableChangeQuotedColumn(): void
$table->addColumn('select', Types::INTEGER);

$tableDiff = new TableDiff($table, changedColumns: [
new ColumnDiff(
'select' => new ColumnDiff(
$table->getColumn('select'),
new Column(
'select',
Expand Down Expand Up @@ -859,7 +859,7 @@ public function testAlterStringToFixedString(): void
$table->addColumn('name', Types::STRING, ['length' => 2]);

$tableDiff = new TableDiff($table, changedColumns: [
new ColumnDiff(
'name' => new ColumnDiff(
$table->getColumn('name'),
new Column(
'name',
Expand Down Expand Up @@ -985,28 +985,3 @@ public static function asciiStringSqlDeclarationDataProvider(): array
];
}
}

interface GetCreateTableSqlDispatchEventListener
{
public function onSchemaCreateTable(): void;

public function onSchemaCreateTableColumn(): void;
}

interface GetAlterTableSqlDispatchEventListener
{
public function onSchemaAlterTable(SchemaAlterTableEventArgs $args): void;

public function onSchemaAlterTableAddColumn(SchemaAlterTableAddColumnEventArgs $args): void;

public function onSchemaAlterTableRemoveColumn(SchemaAlterTableRemoveColumnEventArgs $args): void;

public function onSchemaAlterTableChangeColumn(SchemaAlterTableChangeColumnEventArgs $args): void;

public function onSchemaAlterTableRenameColumn(SchemaAlterTableRenameColumnEventArgs $args): void;
}

interface GetDropTableSqlDispatchEventListener
{
public function onSchemaDropTable(): void;
}
2 changes: 1 addition & 1 deletion tests/Platforms/DB2PlatformTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ public function testGeneratesAlterColumnSQL(
bool $shouldReorg = true,
): void {
$tableDiff = new TableDiff(new Table('foo'), changedColumns: [
new ColumnDiff($oldColumn, $newColumn),
$oldColumn->getName() => new ColumnDiff($oldColumn, $newColumn),
]);

$expectedSQL = [];
Expand Down
6 changes: 3 additions & 3 deletions tests/Platforms/SQLServerPlatformTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ public function testAlterTableWithSchemaDropColumnComments(): void
$table = new Table('testschema.mytable');

$tableDiff = new TableDiff($table, changedColumns: [
new ColumnDiff(
'quota' => new ColumnDiff(
new Column('quota', Type::getType(Types::INTEGER), ['comment' => 'A comment']),
new Column('quota', Type::getType(Types::INTEGER), []),
),
Expand All @@ -687,7 +687,7 @@ public function testAlterTableWithSchemaUpdateColumnComments(): void
$table = new Table('testschema.mytable');

$tableDiff = new TableDiff($table, changedColumns: [
new ColumnDiff(
'quota' => new ColumnDiff(
new Column('quota', Type::getType(Types::INTEGER), ['comment' => 'A comment']),
new Column('quota', Type::getType(Types::INTEGER), ['comment' => 'B comment']),
),
Expand Down Expand Up @@ -1062,7 +1062,7 @@ public function testAlterTableWithSchemaSameColumnComments(): void
$table = new Table('testschema.mytable');

$tableDiff = new TableDiff($table, changedColumns: [
new ColumnDiff(
'quota' => new ColumnDiff(
new Column('quota', Type::getType(Types::INTEGER), ['comment' => 'A comment', 'notnull' => false]),
new Column('quota', Type::getType(Types::INTEGER), ['comment' => 'A comment', 'notnull' => true]),
),
Expand Down
4 changes: 2 additions & 2 deletions tests/Platforms/SQLitePlatformTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,11 @@ public function testAlterTable(): void
$diff = new TableDiff(
$table,
changedColumns: [
new ColumnDiff(
'id' => new ColumnDiff(
$table->getColumn('id'),
new Column('key', Type::getType(Types::INTEGER)),
),
new ColumnDiff(
'post' => new ColumnDiff(
$table->getColumn('post'),
new Column('comment', Type::getType(Types::INTEGER)),
),
Expand Down

0 comments on commit 948b8ca

Please sign in to comment.