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