Skip to content

Commit 80445f0

Browse files
authored
Change $typeMap to constant (#324)
1 parent 9782f39 commit 80445f0

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 1.2.1 under development
44

5-
- no changes in this release.
5+
- Enh #324: Change property `Schema::$typeMap` to constant `Schema::TYPE_MAP` (@Tigrov)
66

77
## 1.2.0 November 12, 2023
88

src/Schema.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ final class Schema extends AbstractPdoSchema
8787
public const TYPE_BIT = 'bit';
8888

8989
/**
90-
* @var array The mapping from physical column types (keys) to abstract column types (values).
90+
* The mapping from physical column types (keys) to abstract column types (values).
9191
*
92-
* @link https://www.postgresql.org/docs/current/static/datatype.html#DATATYPE-TABLE
92+
* @link https://www.postgresql.org/docs/current/datatype.html#DATATYPE-TABLE
9393
*
94-
* @psalm-var string[]
94+
* @var string[]
9595
*/
96-
private array $typeMap = [
96+
private const TYPE_MAP = [
9797
'bit' => self::TYPE_BIT,
9898
'bit varying' => self::TYPE_BIT,
9999
'varbit' => self::TYPE_BIT,
@@ -807,7 +807,7 @@ protected function loadColumnSchema(array $info): ColumnSchemaInterface
807807
$column->sequenceName($this->resolveTableName($info['sequence_name'])->getFullName());
808808
}
809809

810-
$column->type($this->typeMap[(string) $column->getDbType()] ?? self::TYPE_STRING);
810+
$column->type(self::TYPE_MAP[(string) $column->getDbType()] ?? self::TYPE_STRING);
811811
$column->phpType($this->getColumnPhpType($column));
812812
$column->defaultValue($this->normalizeDefaultValue($defaultValue, $column));
813813

0 commit comments

Comments
 (0)