Conditions | 4 |
Paths | 5 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | public function __get($key) { |
||
31 | $accessor = 'get' . Str::studly($key) . 'Attribute'; |
||
32 | |||
33 | if (method_exists($this, $accessor)) { |
||
34 | return $this->$accessor(); |
||
35 | } |
||
36 | |||
37 | try { |
||
38 | if ($this->has($key)) { |
||
39 | return $this->content[$key]; |
||
40 | } |
||
41 | |||
42 | return false; |
||
43 | } catch (Exception $e) { |
||
44 | return 'Caught exception: ' . $e->getMessage(); |
||
45 | } |
||
49 | } |