vendor/overblog/graphql-bundle/src/Resolver/AbstractProxyResolver.php line 16

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Overblog\GraphQLBundle\Resolver;
  4. use function is_array;
  5. abstract class AbstractProxyResolver extends AbstractResolver
  6. {
  7.     /**
  8.      * @param mixed $input
  9.      *
  10.      * @return mixed
  11.      */
  12.     public function resolve($input)
  13.     {
  14.         if (!is_array($input)) {
  15.             $input = [$input];
  16.         }
  17.         $alias $input[0] ?? '';
  18.         $funcArgs $input[1] ?? [];
  19.         $solution $this->getSolution($alias);
  20.         if (null === $solution) {
  21.             throw new UnresolvableException($this->unresolvableMessage($alias));
  22.         }
  23.         $options $this->getSolutionOptions($alias);
  24.         /** @var callable $func */
  25.         $func = [$solution$options['method']];
  26.         return $func(...$funcArgs);
  27.     }
  28.     abstract protected function unresolvableMessage(string $alias): string;
  29. }