Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3.0123 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php declare(strict_types = 1); |
||
13 | 1 | public function resolve(string $column, ...$values): string |
|
14 | { |
||
15 | 1 | $mapping = $this->getResolvers(); |
|
16 | 1 | foreach ($mapping as $pattern => $resolver) { |
|
17 | 1 | $matches = []; |
|
18 | 1 | if ((bool) preg_match_all("#^{$pattern}$#", $column, $matches, PREG_SET_ORDER) === false) { |
|
19 | 1 | continue; |
|
20 | } |
||
21 | |||
22 | 1 | array_push($values, $matches); |
|
23 | |||
24 | 1 | return call_user_func_array($resolver, $values); |
|
25 | } |
||
26 | |||
27 | throw new InvalidArgumentException($column); |
||
28 | } |
||
37 |