Completed
Push — master ( 145f77...f73370 )
by James Ekow Abaka
04:01
created

MysqlAdapter   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 80%

Importance

Changes 4
Bugs 1 Features 1
Metric Value
wmc 8
c 4
b 1
f 1
lcom 0
cbo 1
dl 0
loc 24
ccs 12
cts 15
cp 0.8
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B mapDataTypes() 0 21 8
1
<?php
2
namespace ntentan\nibii\adapters;
3
4
class MysqlAdapter extends \ntentan\nibii\DriverAdapter
5
{
6 4
    public function mapDataTypes($nativeType)
7
    {
8
        switch($nativeType)
9
        {
10 4
            case 'int':
11 4
                return 'integer';
12 4
            case 'varchar':
13 4
                return 'string';
14 4
            case 'tinyint':
15 2
                return 'boolean';
16 4
            case 'timestamp':
17 2
            case 'datetime':
18 2
                return 'datetime';
19 2
            case 'text':
20 2
                return 'text';
21
            case 'date':
22
                return 'date';
23
            default:
24
                throw new \Exception("Unknown type {$nativeType}");
25
        }
26
    }
27
}
28