Skip to content

Commit

Permalink
Change property Schema::$typeMap to constant Schema::TYPE_MAP (yi…
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov authored Nov 16, 2023
1 parent dae9a9c commit ebb4645
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 1.2.1 under development

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

## 1.2.0 November 12, 2023

Expand Down
8 changes: 4 additions & 4 deletions src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@
final class Schema extends AbstractPdoSchema
{
/**
* @var array The mapping from physical column types (keys) to abstract column types (values).
* The mapping from physical column types (keys) to abstract column types (values).
*
* @link https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html
*
* @psalm-var string[]
* @var string[]
*/
private array $typeMap = [
private const TYPE_MAP = [
'char' => self::TYPE_CHAR,
'nchar' => self::TYPE_CHAR,
'varchar2' => self::TYPE_STRING,
Expand Down Expand Up @@ -664,7 +664,7 @@ private function extractColumnType(ColumnSchemaInterface $column): string
return self::TYPE_STRING;
}

return $this->typeMap[$dbType] ?? self::TYPE_STRING;
return self::TYPE_MAP[$dbType] ?? self::TYPE_STRING;
}

/**
Expand Down

0 comments on commit ebb4645

Please sign in to comment.