Skip to content

Commit

Permalink
codefactor issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rodber committed Jan 12, 2024
1 parent 66e6ee6 commit d831080
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/SQL2P.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ private function writeColumn(string $table, array $column): void
$arguments = [];
$columnName = $column['name'];
$columnType = $column['type'];
$function = self::TRANSLATION[$column['type']]
?? throw new LogicException("Unsupported type {$columnType} for {$table}.{$columnName}");
$function = self::TRANSLATION[$column['type']] ?? null;
if ($function === null) {
throw new LogicException("Unsupported type {$columnType} for {$table}.{$columnName}");
}
if ($columnType === 'TINYINT' && $column['length'] === '1') {
$function = 'boolInt';
}
Expand Down

0 comments on commit d831080

Please sign in to comment.