Skip to content

Commit

Permalink
Change Schema::$typeMap to constant Schema::TYPE_MAP
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Nov 16, 2023
1 parent a4551e6 commit 151f137
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@
final class Schema extends AbstractPdoSchema
{
/**
* @var array Mapping from physical column types (keys) to abstract column types (values).
* Mapping from physical column types (keys) to abstract column types (values).
*
* @psalm-var string[]
* @var string[]
*/
private array $typeMap = [
private const TYPE_MAP = [
'tinyint' => self::TYPE_TINYINT,
'bit' => self::TYPE_INTEGER,
'smallint' => self::TYPE_SMALLINT,
Expand Down Expand Up @@ -490,8 +490,8 @@ protected function loadColumnSchema(array $info): ColumnSchemaInterface
if (preg_match('/^(\w+)(?:\(([^)]+)\))?/', $dbType, $matches)) {
$type = strtolower($matches[1]);

if (isset($this->typeMap[$type])) {
$column->type($this->typeMap[$type]);
if (isset(self::TYPE_MAP[$type])) {
$column->type(self::TYPE_MAP[$type]);
}

if (!empty($matches[2])) {
Expand Down

0 comments on commit 151f137

Please sign in to comment.