| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | 5 | public function toReference(): SetReference |
|
| 37 | { |
||
| 38 | $reference = SetReference::all()->first(function ($setReference) { |
||
| 39 | 5 | return $setReference->key() == $this->key; |
|
| 40 | 5 | }); |
|
| 41 | |||
| 42 | 5 | if (!$reference) { |
|
| 43 | 1 | throw new \Exception('No query set found by key ['. $this->key. ']. Make sure that this '.$this->key.' set is added to the chief.sets config array.'); |
|
|
|
|||
| 44 | } |
||
| 45 | |||
| 46 | 4 | return $reference; |
|
| 47 | } |
||
| 64 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.