Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function getAttribute(string $attribute) |
||
28 | { |
||
29 | assert($this instanceof ModelInterface); |
||
30 | if ($this->getModelsMetaData()->hasAttribute($this, $attribute)) { |
||
31 | |||
32 | $method = 'get' . ucfirst(Text::camelize($attribute)); |
||
33 | if (method_exists($this, $method)) { |
||
34 | return $this->$method(); |
||
35 | } |
||
36 | |||
37 | return $this->readAttribute($attribute); |
||
38 | } |
||
39 | |||
40 | return null; |
||
41 | } |
||
63 |