| Conditions | 9 |
| Paths | 9 |
| Total Lines | 22 |
| Lines | 22 |
| Ratio | 100 % |
| Tests | 13 |
| CRAP Score | 10.0551 |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | 14 | public function mapDataTypes($nativeType) |
|
| 14 | { |
||
| 15 | 14 | switch($nativeType) |
|
| 16 | { |
||
| 17 | 14 | case 'character varying': |
|
| 18 | 14 | return 'string'; |
|
| 19 | 14 | case 'text': |
|
| 20 | 2 | return 'text'; |
|
| 21 | 14 | case 'date': |
|
| 22 | return 'date'; |
||
| 23 | 14 | case 'integer': |
|
| 24 | 11 | case 'boolean': |
|
| 25 | 14 | return $nativeType; |
|
| 26 | 11 | case 'numeric': |
|
| 27 | return 'double'; |
||
| 28 | 11 | case 'timestamp without time zone': |
|
| 29 | case 'timestamp with time zone': |
||
| 30 | 11 | return 'datetime'; |
|
| 31 | default: |
||
| 32 | throw new \Exception("Unknown type {$nativeType}"); |
||
| 33 | } |
||
| 34 | } |
||
| 35 | } |
||
| 36 |