| Conditions | 4 |
| Paths | 3 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function present() |
||
| 19 | { |
||
| 20 | if (is_object($this->presenterInstance)) { |
||
| 21 | return $this->presenterInstance; |
||
| 22 | } |
||
| 23 | |||
| 24 | if (property_exists($this, 'presenter') && class_exists($this->presenter)) { |
||
| 25 | return $this->presenterInstance = new $this->presenter($this); |
||
| 26 | } |
||
| 27 | |||
| 28 | throw new PresenterException('Property $presenter was not set correctly in ' . get_class($this)); |
||
| 29 | } |
||
| 30 | } |
||
| 31 |