Skip to content

Commit a9de52f

Browse files
committed
PHPStan fixes
1 parent ebb87c5 commit a9de52f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Utils/ColumnsReorderer.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static function reorderTableColumns(Schema $schema): void
2525
}
2626
}
2727

28-
private static function reorderColumnsForTable(Table $table)
28+
private static function reorderColumnsForTable(Table $table): void
2929
{
3030
$columns = self::getColumnsInExpectedOrder($table);
3131

@@ -49,8 +49,9 @@ private static function reorderColumnsForTable(Table $table)
4949
* @return Column[]
5050
*/
5151
private static function getColumnsInExpectedOrder(Table $table): array {
52-
if ($table->hasPrimaryKey()) {
53-
$pkColumns = $table->getPrimaryKey()->getUnquotedColumns();
52+
$primaryKey = $table->getPrimaryKey();
53+
if ($primaryKey !== null) {
54+
$pkColumns = $primaryKey->getUnquotedColumns();
5455
} else {
5556
$pkColumns = [];
5657
}

0 commit comments

Comments
 (0)