| Total Complexity | 5 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class Column |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Create new column. |
||
| 12 | * |
||
| 13 | * @param array $column |
||
| 14 | * |
||
| 15 | * @return \Doctrine\DBAL\Schema\Column |
||
| 16 | */ |
||
| 17 | public static function create($column) |
||
| 18 | { |
||
| 19 | $name = $column['name']; |
||
| 20 | $type = $column['type']; |
||
| 21 | $type = ($type instanceof DoctrineType) ? $type : DoctrineType::getType(trim($type['name'])); |
||
| 22 | |||
| 23 | $options = array_diff_key($column, ['name' => $name, 'type' => $type]); |
||
| 24 | |||
| 25 | $DoctrineColumn = new DoctrineColumn($name, $type, $options); |
||
| 26 | |||
| 27 | return $DoctrineColumn; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Get all columns as an array. |
||
| 32 | * |
||
| 33 | * @return array |
||
| 34 | */ |
||
| 35 | public static function toArray(DoctrineColumn $column) |
||
| 49 | } |
||
| 50 | } |
||
| 51 |