File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 3
3
## 1.1.1 under development
4
4
5
5
- Enh #281 : Remove unused code in ` Command ` class (@vjik )
6
+ - Enh #282 : Change property ` Schema::$typeMap ` to constant ` Schema::TYPE_MAP ` (@Tigrov )
6
7
7
8
## 1.1.0 November 12, 2023
8
9
Original file line number Diff line number Diff line change 72
72
final class Schema extends AbstractPdoSchema
73
73
{
74
74
/**
75
- * @var string[] Mapping from physical column types (keys) to abstract column types (values).
75
+ * Mapping from physical column types (keys) to abstract column types (values).
76
+ *
77
+ * @var string[]
76
78
*/
77
- private array $ typeMap = [
79
+ private const TYPE_MAP = [
78
80
'tinyint ' => self ::TYPE_TINYINT ,
79
81
'bit ' => self ::TYPE_SMALLINT ,
80
82
'boolean ' => self ::TYPE_BOOLEAN ,
@@ -481,8 +483,8 @@ protected function loadColumnSchema(array $info): ColumnSchemaInterface
481
483
if (preg_match ('/^(\w+)(?:\(([^)]+)\))?/ ' , $ column ->getDbType () ?? '' , $ matches )) {
482
484
$ type = strtolower ($ matches [1 ]);
483
485
484
- if (isset ($ this -> typeMap [$ type ])) {
485
- $ column ->type ($ this -> typeMap [$ type ]);
486
+ if (isset (self :: TYPE_MAP [$ type ])) {
487
+ $ column ->type (self :: TYPE_MAP [$ type ]);
486
488
}
487
489
488
490
if (!empty ($ matches [2 ])) {
You can’t perform that action at this time.
0 commit comments