We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 6 |
Paths | 12 |
Total Lines | 31 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 20 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | 19 | public function resolve($input) |
|
24 | { |
||
25 | 19 | if (!is_array($input)) { |
|
26 | 2 | $input = [$input]; |
|
27 | 2 | } |
|
28 | |||
29 | 19 | if (!isset($input[0]) || !isset($input[1])) { |
|
30 | 2 | $optionResolver = new OptionsResolver(); |
|
31 | 2 | $optionResolver->setDefaults([null, []]); |
|
32 | 2 | $input = $optionResolver->resolve($input); |
|
33 | 2 | } |
|
34 | |||
35 | 19 | $alias = $input[0]; |
|
36 | 19 | $funcArgs = $input[1]; |
|
37 | |||
38 | 19 | if (null === $func = $this->cache->fetch($alias)) { |
|
39 | 19 | $solution = $this->getSolution($alias); |
|
40 | |||
41 | 19 | if (null === $solution) { |
|
42 | 2 | throw new UnresolvableException($this->unresolvableMessage($alias)); |
|
43 | } |
||
44 | |||
45 | 17 | $options = $this->getSolutionOptions($alias); |
|
46 | |||
47 | 17 | $func = [$solution, $options['method']]; |
|
48 | |||
49 | 17 | $this->cache->save($alias, $func); |
|
50 | 17 | } |
|
51 | |||
52 | 17 | return call_user_func_array($func, $funcArgs); |
|
53 | } |
||
54 | |||
57 |