Skip to content

Commit ec6aa0b

Browse files
authored
Merge pull request #5630 from morozov/rework-exec-sql
Rework AbstractSchemaManager::_execSql()
2 parents 035b4a8 + 902f117 commit ec6aa0b

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/Schema/AbstractSchemaManager.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ public function dropView(string $name): void
497497
*/
498498
public function createSchemaObjects(Schema $schema): void
499499
{
500-
$this->_execSql($schema->toSql($this->platform));
500+
$this->executeStatements($schema->toSql($this->platform));
501501
}
502502

503503
/**
@@ -519,7 +519,7 @@ public function createDatabase(string $database): void
519519
*/
520520
public function createTable(Table $table): void
521521
{
522-
$this->_execSql($this->platform->getCreateTableSQL($table));
522+
$this->executeStatements($this->platform->getCreateTableSQL($table));
523523
}
524524

525525
/**
@@ -595,7 +595,7 @@ public function createView(View $view): void
595595
*/
596596
public function dropSchemaObjects(Schema $schema): void
597597
{
598-
$this->_execSql($schema->toDropSql($this->platform));
598+
$this->executeStatements($schema->toDropSql($this->platform));
599599
}
600600

601601
/**
@@ -605,7 +605,7 @@ public function dropSchemaObjects(Schema $schema): void
605605
*/
606606
public function alterSchema(SchemaDiff $schemaDiff): void
607607
{
608-
$this->_execSql($schemaDiff->toSql($this->platform));
608+
$this->executeStatements($schemaDiff->toSql($this->platform));
609609
}
610610

611611
/**
@@ -630,7 +630,7 @@ public function migrateSchema(Schema $toSchema): void
630630
*/
631631
public function alterTable(TableDiff $tableDiff): void
632632
{
633-
$this->_execSql($this->platform->getAlterTableSQL($tableDiff));
633+
$this->executeStatements($this->platform->getAlterTableSQL($tableDiff));
634634
}
635635

636636
/**
@@ -833,15 +833,13 @@ protected function _getPortableTableForeignKeysList(array $tableForeignKeys): ar
833833
abstract protected function _getPortableTableForeignKeyDefinition(array $tableForeignKey): ForeignKeyConstraint;
834834

835835
/**
836-
* @internal
837-
*
838-
* @param array<int, string>|string $sql
836+
* @param array<int, string> $sql
839837
*
840838
* @throws Exception
841839
*/
842-
protected function _execSql(array|string $sql): void
840+
private function executeStatements(array $sql): void
843841
{
844-
foreach ((array) $sql as $query) {
842+
foreach ($sql as $query) {
845843
$this->connection->executeStatement($query);
846844
}
847845
}

0 commit comments

Comments
 (0)