| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function read($expression, PropertyAccessor $accessor) |
||
| 22 | { |
||
| 23 | if (is_array($this->content)) { |
||
| 24 | $expression = preg_replace('/^root/', '', $expression); |
||
| 25 | } else { |
||
| 26 | $expression = preg_replace('/^root./', '', $expression); |
||
| 27 | } |
||
| 28 | |||
| 29 | // If root asked, we return the entire content |
||
| 30 | if (strlen(trim($expression)) <= 0) { |
||
| 31 | return $this->content; |
||
| 32 | } |
||
| 33 | |||
| 34 | return $accessor->getValue($this->content, $expression); |
||
| 35 | } |
||
| 36 | |||
| 63 |