| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | 3 | public function getCasts() |
|
| 8 | { |
||
| 9 | 3 | $class = static::class; |
|
| 10 | |||
| 11 | 3 | foreach (class_uses_recursive($class) as $trait) { |
|
| 12 | 3 | $method = 'get'.class_basename($trait).'CastsAttr'; |
|
| 13 | |||
| 14 | 3 | if (method_exists($class, $method)) { |
|
| 15 | 3 | $this->casts = array_merge($this->casts, $this->{$method}()); |
|
|
|
|||
| 16 | } |
||
| 17 | } |
||
| 18 | |||
| 19 | 3 | return parent::getCasts(); |
|
| 20 | } |
||
| 22 |