Skip to content

Commit

Permalink
Fix issue psalm. (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Mar 21, 2023
1 parent d0cb221 commit 581e2f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Schema.php
Expand Up @@ -361,7 +361,7 @@ protected function findColumns(TableSchemaInterface $table): bool

$column = count($table->getPrimaryKey()) === 1 ? $table->getColumn($table->getPrimaryKey()[0]) : null;

if ($column !== null && !strncasecmp($column->getDbType(), 'int', 3)) {
if ($column !== null && !strncasecmp($column->getDbType() ?? '', 'int', 3)) {
$table->sequenceName('');
$column->autoIncrement(true);
}
Expand Down Expand Up @@ -461,10 +461,10 @@ protected function loadColumnSchema(array $info): ColumnSchemaInterface
$column->allowNull(!$info['notnull']);
$column->primaryKey($info['pk'] != '0');
$column->dbType(strtolower($info['type']));
$column->unsigned(str_contains($column->getDbType(), 'unsigned'));
$column->unsigned(str_contains($column->getDbType() ?? '', 'unsigned'));
$column->type(self::TYPE_STRING);

if (preg_match('/^(\w+)(?:\(([^)]+)\))?/', $column->getDbType(), $matches)) {
if (preg_match('/^(\w+)(?:\(([^)]+)\))?/', $column->getDbType() ?? '', $matches)) {
$type = strtolower($matches[1]);

if (isset($this->typeMap[$type])) {
Expand Down

0 comments on commit 581e2f6

Please sign in to comment.