| Conditions | 4 |
| Paths | 6 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4 |
| 1 | <?php |
||
| 44 | 8 | public function compile() |
|
| 45 | { |
||
| 46 | 8 | $name = ($this->toName) ? $this->toName : $this->name; |
|
| 47 | |||
| 48 | 8 | if (is_callable($this->getterCallable)) { |
|
| 49 | 8 | $value = call_user_func($this->getterCallable, $this->object, $this->name); |
|
| 50 | 8 | } else { |
|
| 51 | 8 | $value = ($this->object->{$this->name}) ? $this->object->{$this->name} : $this->defaultValue; |
|
| 52 | } |
||
| 53 | |||
| 54 | 8 | return [$name => $value]; |
|
| 55 | } |
||
| 56 | |||
| 69 |