We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 17 | class ResolverResolver extends AbstractResolver |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @param $input |
||
| 21 | * |
||
| 22 | * @return mixed |
||
| 23 | */ |
||
| 24 | 4 | public function resolve($input) |
|
| 25 | { |
||
| 26 | 4 | if (!is_array($input)) { |
|
| 27 | 2 | $input = [$input]; |
|
| 28 | 2 | } |
|
| 29 | |||
| 30 | 4 | if (!isset($input[0]) || !isset($input[1])) { |
|
| 31 | 2 | $optionResolver = new OptionsResolver(); |
|
| 32 | 2 | $optionResolver->setDefaults([null, []]); |
|
| 33 | 2 | $input = $optionResolver->resolve($input); |
|
| 34 | 2 | } |
|
| 35 | |||
| 36 | 4 | $alias = $input[0]; |
|
| 37 | 4 | $funcArgs = $input[1]; |
|
| 38 | |||
| 39 | 4 | if (null === $func = $this->cache->fetch($alias)) { |
|
| 40 | 4 | $options = $this->getResolverServiceOptionsFromAlias($alias); |
|
| 41 | |||
| 42 | 2 | $resolver = $this->container->get($options['id']); |
|
| 43 | 2 | if ($resolver instanceof ContainerAwareInterface) { |
|
| 44 | $resolver->setContainer($this->container); |
||
| 45 | } |
||
| 46 | 2 | $func = [$resolver, $options['method']]; |
|
| 47 | |||
| 48 | 2 | $this->cache->save($alias, $func); |
|
| 49 | 2 | } |
|
| 50 | |||
| 51 | 2 | return call_user_func_array($func, $funcArgs); |
|
| 52 | } |
||
| 53 | |||
| 54 | 4 | private function getResolverServiceOptionsFromAlias($alias) |
|
| 66 | |||
| 67 | 2 | protected function getMapping() |
|
| 71 | |||
| 72 | 1 | protected function unresolvableMessage($alias) |
|
| 76 | } |
||
| 77 |