| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 2.5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | 3 | public function matchOne(array $conditions) |
|
| 35 | { |
||
| 36 | $results = $this->match($conditions); |
||
| 37 | $count = count($results); |
||
| 38 | 3 | if ($count !== 1) { |
|
| 39 | 3 | throw new \Exception("Found $count " . $this->returns . " when expected exactly only one to match the conditions"); |
|
| 40 | } |
||
| 41 | return reset($results); |
||
| 42 | } |
||
| 43 | 3 | ||
| 46 |