Skip to content

Commit

Permalink
Remove redundant calls to Column::getComment()
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Feb 24, 2025
1 parent 4d0c016 commit f146c57
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/Platforms/AbstractMySQLPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,7 @@ public function getAlterTableSQL(TableDiff $diff): array
$queryParts = [];

foreach ($diff->getAddedColumns() as $column) {
$columnProperties = array_merge($column->toArray(), [
'comment' => $column->getComment(),
]);
$columnProperties = array_merge($column->toArray());

$queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($columnProperties);
}
Expand All @@ -343,9 +341,7 @@ public function getAlterTableSQL(TableDiff $diff): array
foreach ($diff->getChangedColumns() as $columnDiff) {
$newColumn = $columnDiff->getNewColumn();

$newColumnProperties = array_merge($newColumn->toArray(), [
'comment' => $newColumn->getComment(),
]);
$newColumnProperties = $newColumn->toArray();

$oldColumn = $columnDiff->getOldColumn();

Expand Down
1 change: 0 additions & 1 deletion src/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2076,7 +2076,6 @@ private function columnToArray(Column $column): array
{
return array_merge($column->toArray(), [
'version' => $column->hasPlatformOption('version') ? $column->getPlatformOption('version') : false,
'comment' => $column->getComment(),
]);
}

Expand Down

0 comments on commit f146c57

Please sign in to comment.