Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | 7 | public function castAttribute($attribute) |
|
35 | { |
||
36 | 7 | switch ($this->getAttributeCastType($attribute)) { |
|
37 | 7 | case 'date': |
|
38 | 5 | $value = (string) IgfsUtils::formatXMLGregorianCalendar($this->{$attribute}); |
|
39 | |||
40 | 5 | break; |
|
41 | 7 | case 'array': |
|
42 | 1 | $value = (array) $this->{$attribute}; |
|
43 | |||
44 | 1 | break; |
|
45 | default: |
||
46 | 7 | $value = (string) $this->{$attribute}; |
|
47 | |||
48 | 7 | break; |
|
49 | } |
||
50 | |||
51 | 7 | return $value; |
|
52 | } |
||
66 |