diff --git a/src/Utils/ASTDefinitionBuilder.php b/src/Utils/ASTDefinitionBuilder.php index 6e985a3..8e452e2 100644 --- a/src/Utils/ASTDefinitionBuilder.php +++ b/src/Utils/ASTDefinitionBuilder.php @@ -45,7 +45,7 @@ use function sprintf; class ASTDefinitionBuilder { /** @var Node[] */ - private $typeDefintionsMap; + private $typeDefinitionsMap; /** @var callable */ private $typeConfigDecorator; @@ -60,16 +60,16 @@ class ASTDefinitionBuilder private $cache; /** - * @param Node[] $typeDefintionsMap + * @param Node[] $typeDefinitionsMap * @param bool[] $options */ public function __construct( - array $typeDefintionsMap, + array $typeDefinitionsMap, $options, callable $resolveType, ?callable $typeConfigDecorator = null ) { - $this->typeDefintionsMap = $typeDefintionsMap; + $this->typeDefinitionsMap = $typeDefinitionsMap; $this->typeConfigDecorator = $typeConfigDecorator; $this->options = $options; $this->resolveType = $resolveType; @@ -199,12 +199,12 @@ class ASTDefinitionBuilder private function internalBuildType($typeName, $typeNode = null) { if (! isset($this->cache[$typeName])) { - if (isset($this->typeDefintionsMap[$typeName])) { - $type = $this->makeSchemaDef($this->typeDefintionsMap[$typeName]); + if (isset($this->typeDefinitionsMap[$typeName])) { + $type = $this->makeSchemaDef($this->typeDefinitionsMap[$typeName]); if ($this->typeConfigDecorator) { $fn = $this->typeConfigDecorator; try { - $config = $fn($type->config, $this->typeDefintionsMap[$typeName], $this->typeDefintionsMap); + $config = $fn($type->config, $this->typeDefinitionsMap[$typeName], $this->typeDefinitionsMap); } catch (Throwable $e) { throw new Error( sprintf('Type config decorator passed to %s threw an error ', static::class) . @@ -225,7 +225,7 @@ class ASTDefinitionBuilder ) ); } - $type = $this->makeSchemaDefFromConfig($this->typeDefintionsMap[$typeName], $config); + $type = $this->makeSchemaDefFromConfig($this->typeDefinitionsMap[$typeName], $config); } $this->cache[$typeName] = $type; } else { diff --git a/src/Utils/BuildSchema.php b/src/Utils/BuildSchema.php index ae79c01..cf0eb7b 100644 --- a/src/Utils/BuildSchema.php +++ b/src/Utils/BuildSchema.php @@ -135,7 +135,7 @@ class BuildSchema 'subscription' => isset($this->nodeMap['Subscription']) ? 'Subscription' : null, ]; - $defintionBuilder = new ASTDefinitionBuilder( + $DefinitionBuilder = new ASTDefinitionBuilder( $this->nodeMap, $this->options, static function ($typeName) { @@ -145,8 +145,8 @@ class BuildSchema ); $directives = array_map( - static function ($def) use ($defintionBuilder) { - return $defintionBuilder->buildDirective($def); + static function ($def) use ($DefinitionBuilder) { + return $DefinitionBuilder->buildDirective($def); }, $directiveDefs ); @@ -188,23 +188,23 @@ class BuildSchema return new Schema([ 'query' => isset($operationTypes['query']) - ? $defintionBuilder->buildType($operationTypes['query']) + ? $DefinitionBuilder->buildType($operationTypes['query']) : null, 'mutation' => isset($operationTypes['mutation']) - ? $defintionBuilder->buildType($operationTypes['mutation']) + ? $DefinitionBuilder->buildType($operationTypes['mutation']) : null, 'subscription' => isset($operationTypes['subscription']) - ? $defintionBuilder->buildType($operationTypes['subscription']) + ? $DefinitionBuilder->buildType($operationTypes['subscription']) : null, - 'typeLoader' => static function ($name) use ($defintionBuilder) { - return $defintionBuilder->buildType($name); + 'typeLoader' => static function ($name) use ($DefinitionBuilder) { + return $DefinitionBuilder->buildType($name); }, 'directives' => $directives, 'astNode' => $schemaDef, - 'types' => function () use ($defintionBuilder) { + 'types' => function () use ($DefinitionBuilder) { $types = []; foreach ($this->nodeMap as $name => $def) { - $types[] = $defintionBuilder->buildType($def->name->value); + $types[] = $DefinitionBuilder->buildType($def->name->value); } return $types; diff --git a/tests/Executor/ValuesTest.php b/tests/Executor/ValuesTest.php index 7aa85d2..f972960 100644 --- a/tests/Executor/ValuesTest.php +++ b/tests/Executor/ValuesTest.php @@ -80,28 +80,28 @@ class ValuesTest extends TestCase */ private static function getVariableDefinitionNodes() : array { - $idInputDefinition = new VariableDefinitionNode([ + $idInputDefinition = new VariableDefinitionNode([ 'variable' => new VariableNode(['name' => new NameNode(['value' => 'idInput'])]), 'type' => new NamedTypeNode(['name' => new NameNode(['value' => 'ID'])]), ]); - $boolInputDefinition = new VariableDefinitionNode([ + $boolInputDefinition = new VariableDefinitionNode([ 'variable' => new VariableNode(['name' => new NameNode(['value' => 'boolInput'])]), 'type' => new NamedTypeNode(['name' => new NameNode(['value' => 'Boolean'])]), ]); - $intInputDefinition = new VariableDefinitionNode([ + $intInputDefinition = new VariableDefinitionNode([ 'variable' => new VariableNode(['name' => new NameNode(['value' => 'intInput'])]), 'type' => new NamedTypeNode(['name' => new NameNode(['value' => 'Int'])]), ]); - $stringInputDefintion = new VariableDefinitionNode([ + $stringInputDefinition = new VariableDefinitionNode([ 'variable' => new VariableNode(['name' => new NameNode(['value' => 'stringInput'])]), 'type' => new NamedTypeNode(['name' => new NameNode(['value' => 'String'])]), ]); - $floatInputDefinition = new VariableDefinitionNode([ + $floatInputDefinition = new VariableDefinitionNode([ 'variable' => new VariableNode(['name' => new NameNode(['value' => 'floatInput'])]), 'type' => new NamedTypeNode(['name' => new NameNode(['value' => 'Float'])]), ]); - return [$idInputDefinition, $boolInputDefinition, $intInputDefinition, $stringInputDefintion, $floatInputDefinition]; + return [$idInputDefinition, $boolInputDefinition, $intInputDefinition, $stringInputDefinition, $floatInputDefinition]; } public function testGetBooleanVariableValues() : void