Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
15 | public function getConstraint(string $key, string $q): Constraint |
||
16 | { |
||
17 | $constraints = $this->getAvailableConstraints()->all(); |
||
18 | if (! Arr::has($constraints, $key)) { |
||
19 | throw new InvalidArgumentException("The requested index was not found: {$key}"); |
||
20 | } |
||
21 | |||
22 | return Arr::get($constraints, $key)($q); |
||
23 | } |
||
25 |