Total Complexity | 7 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 85.71% |
Changes | 0 |
1 | <?php |
||
14 | class ColumnSchema extends AbstractColumnSchema |
||
15 | { |
||
16 | /** |
||
17 | * {@inheritdoc} |
||
18 | */ |
||
19 | 44 | public function dbTypecast($value) |
|
20 | { |
||
21 | 44 | if ($value === null) { |
|
22 | 5 | return $value; |
|
23 | } |
||
24 | |||
25 | 44 | if ($value instanceof ExpressionInterface) { |
|
26 | 6 | return $value; |
|
27 | } |
||
28 | |||
29 | 42 | if ($this->getDbType() === Schema::TYPE_JSON) { |
|
30 | return new JsonExpression($value, $this->getType()); |
||
31 | } |
||
32 | |||
33 | 42 | return $this->typecast($value); |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | 80 | public function phpTypecast($value) |
|
50 | } |
||
51 | } |
||
52 |