From a2aa631665cf0100c62c779626845ba4335a16f2 Mon Sep 17 00:00:00 2001 From: Jeremiah VALERIE Date: Wed, 22 Dec 2021 11:15:44 +0100 Subject: [PATCH] Fix after rebase --- .../Compiler/IdentifyCallbackServiceIdsPass.php | 2 +- src/Generator/TypeBuilder.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/DependencyInjection/Compiler/IdentifyCallbackServiceIdsPass.php b/src/DependencyInjection/Compiler/IdentifyCallbackServiceIdsPass.php index dfa04066d..45c4fe431 100644 --- a/src/DependencyInjection/Compiler/IdentifyCallbackServiceIdsPass.php +++ b/src/DependencyInjection/Compiler/IdentifyCallbackServiceIdsPass.php @@ -71,7 +71,7 @@ private function resolveServiceIdAndMethod(ContainerBuilder $container, ?array & $alias = $container->getAlias($id); $id = (string) $alias; $definition = $container->getDefinition($id); - } catch (ServiceNotFoundException | InvalidArgumentException $e) { + } catch (ServiceNotFoundException|InvalidArgumentException $e) { if ($throw) { throw $e; } diff --git a/src/Generator/TypeBuilder.php b/src/Generator/TypeBuilder.php index 7b683988d..523a51928 100644 --- a/src/Generator/TypeBuilder.php +++ b/src/Generator/TypeBuilder.php @@ -31,6 +31,7 @@ use Overblog\GraphQLBundle\ExpressionLanguage\ExpressionLanguage as EL; use Overblog\GraphQLBundle\Generator\Config\Arg; use Overblog\GraphQLBundle\Generator\Config\Callback; +use Overblog\GraphQLBundle\Generator\Config\Config as GeneratorConfig; use Overblog\GraphQLBundle\Generator\Config\Field; use Overblog\GraphQLBundle\Generator\Config\Validation; use Overblog\GraphQLBundle\Generator\Converter\ExpressionConverter; @@ -79,7 +80,7 @@ final class TypeBuilder private ExpressionConverter $expressionConverter; private PhpFile $file; private string $namespace; - private Config\Config $config; + private GeneratorConfig $config; private string $type; private string $currentField; private string $gqlServices = '$'.TypeGenerator::GRAPHQL_SERVICES; @@ -114,7 +115,7 @@ public function __construct(ExpressionConverter $expressionConverter, string $na public function build(array $config, string $type): PhpFile { // This values should be accessible from every method - $this->config = new Config\Config($config); + $this->config = new GeneratorConfig($config); $this->type = $type; $this->file = PhpFile::new()->setNamespace($this->namespace); @@ -439,7 +440,7 @@ private function buildScalarCallback($callback, string $fieldName) * * @throws GeneratorException */ - private function buildResolver(Callback $resolver, ?array $groups = null): ?GeneratorInterface + private function buildResolver(Callback $resolver, ?array $groups = null): GeneratorInterface { // TODO: before creating an input validator, check if any validation rules are defined return $this->buildCallback( @@ -874,7 +875,7 @@ private function buildTypeResolver(Callback $typeResolver): GeneratorInterface return $this->buildCallback($typeResolver, ['value', 'context', 'info']); } - protected function buildCallback(Callback $callback, array $argNames, ?callable $expressionBuilder = null): GeneratorInterface + private function buildCallback(Callback $callback, array $argNames, ?callable $expressionBuilder = null): GeneratorInterface { if (null !== $callback->expression) { if (null === $expressionBuilder) {