Skip to content

Commit

Permalink
Remove redundant variable (#6326)
Browse files Browse the repository at this point in the history
<!-- Fill in the relevant information below to help triage your pull
request. -->

|      Q       |   A
|------------- | -----------
| Type         | improvement
| Fixed issues | <!-- use #NUM format to reference an issue -->

#### Summary

Just removing unused variable and redundant `array_merge`. <strike>As I
see Psalm fails here, and not really sure how to fix it, adding
`array_values` probably would solve the issue, but I guess this is not
what we want there?</strike>

Also updated return type on `_getCreateTableSQL` method, to fix the
Psalm issue.

<!-- Provide a summary of your change. -->
  • Loading branch information
michalbundyra authored Jun 4, 2024
1 parent 0ceaf0c commit 754e3ee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -816,8 +816,7 @@ private function buildCreateTableSQL(Table $table, bool $createForeignKeys): arr
}
}

$columnSql = [];
$columns = [];
$columns = [];

foreach ($table->getColumns() as $column) {
$columnData = $this->columnToArray($column);
Expand Down Expand Up @@ -847,7 +846,7 @@ private function buildCreateTableSQL(Table $table, bool $createForeignKeys): arr
}
}

return array_merge($sql, $columnSql);
return $sql;
}

/**
Expand Down Expand Up @@ -945,7 +944,7 @@ public function getInlineColumnCommentSQL(string $comment): string
* @param mixed[][] $columns
* @param mixed[] $options
*
* @return array<int, string>
* @return list<string>
*/
protected function _getCreateTableSQL(string $name, array $columns, array $options = []): array
{
Expand Down

0 comments on commit 754e3ee

Please sign in to comment.