Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.0416 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
7 | 7 | public function __get($key) |
|
8 | { |
||
9 | 7 | if (!property_exists($this, $key)) { |
|
10 | throw new \InvalidArgumentException(sprintf('%s does not exists on %s', $key, get_class($this))); |
||
11 | } |
||
12 | |||
13 | 7 | if ($this->$key instanceof \Closure) { |
|
14 | 7 | $this->$key = call_user_func($this->$key); |
|
15 | } |
||
16 | |||
17 | 7 | return $this->$key; |
|
18 | } |
||
19 | } |