| Conditions | 4 |
| Paths | 3 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function getHandlerFor(string $type) |
||
| 31 | { |
||
| 32 | if (empty($this->handlers[$type])) { |
||
| 33 | throw new \InvalidArgumentException('There is no handler for the "'.$type.'" criteria type.'); |
||
| 34 | } elseif (is_object($this->handlers[$type]) && $this->handlers[$type] instanceof CriteriaHandler) { |
||
| 35 | return $this->handlers[$type]; |
||
| 36 | } |
||
| 37 | |||
| 38 | return new $this->handlers[$type]; |
||
| 39 | } |
||
| 40 | } |
||
| 41 |