Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
crisu83 committed Feb 28, 2018
1 parent 350a538 commit dae3c49
Show file tree
Hide file tree
Showing 133 changed files with 260 additions and 515 deletions.
2 changes: 0 additions & 2 deletions src/ConfigTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public function __construct(array $config = [])
* Override this method to perform logic BEFORE configuration is applied.
* This method is useful for setting default values for properties
* that need to use new -keyword.
*
* If you do, just remember to call the parent implementation.
*/
protected function beforeConfig(): void
Expand All @@ -37,7 +36,6 @@ protected function beforeConfig(): void
* Override this method to perform logic AFTER configuration is applied.
* This method is useful for configuring classes after instantiation,
* e.g. adding a query type to a schema or adding fields to object types.
*
* If you do, just remember to call the parent implementation.
*/
protected function afterConfig(): void
Expand Down
1 change: 1 addition & 0 deletions src/Error/SyntaxError.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

class SyntaxError extends GraphQLError
{

}
27 changes: 15 additions & 12 deletions src/Execution/Execution.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@

/**
* Class Execution
*
* @package Digia\GraphQL\Execution
*/
class Execution
{

/**
* @var ExecutionContext
*/
protected $context;

/**
* Execution constructor.
*
* @param ExecutionContext $context
*/
public function __construct(ExecutionContext $context)
Expand All @@ -28,12 +31,12 @@ public function __construct(ExecutionContext $context)
}

/**
* @param Schema $schema
* @param DocumentNode $documentNode
* @param null $rootValue
* @param null $contextValue
* @param null $variableValues
* @param null $operationName
* @param Schema $schema
* @param DocumentNode $documentNode
* @param null $rootValue
* @param null $contextValue
* @param null $variableValues
* @param null $operationName
* @param callable|null $fieldResolver
* @return ExecutionResult
*/
Expand Down Expand Up @@ -67,12 +70,12 @@ public static function execute(

/**
* @TODO: Consider to create a ExecutionContextBuilder
* @param Schema $schema
* @param DocumentNode $documentNode
* @param $rootValue
* @param $contextValue
* @param $rawVariableValues
* @param null $operationName
* @param Schema $schema
* @param DocumentNode $documentNode
* @param $rootValue
* @param $contextValue
* @param $rawVariableValues
* @param null $operationName
* @param callable|null $fieldResolver
* @throws GraphQLError
* @return ExecutionContext
Expand Down
18 changes: 10 additions & 8 deletions src/Execution/ExecutionArguments.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

class ExecutionArguments
{

/**
* @var Schema
*/
Expand Down Expand Up @@ -45,13 +46,14 @@ class ExecutionArguments

/**
* ExecutionArguments constructor.
* @param Schema $schema
* @param DocumentNode $document
* @param mixed $rootValue
* @param mixed $contextValue
* @param $variableValues
*
* @param Schema $schema
* @param DocumentNode $document
* @param mixed $rootValue
* @param mixed $contextValue
* @param $variableValues
* @param OperationDefinitionNode $operation
* @param mixed $fieldResolver
* @param mixed $fieldResolver
*/
public function __construct(
Schema $schema,
Expand All @@ -60,8 +62,8 @@ public function __construct(
mixed $contextValue,
$variableValues,
OperationDefinitionNode $operation,
mixed $fieldResolver)
{
mixed $fieldResolver
) {
$this->schema = $schema;
$this->document = $document;
$this->rootValue = $rootValue;
Expand Down
21 changes: 11 additions & 10 deletions src/Execution/ExecutionContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

class ExecutionContext
{

/**
* @var Schema
*/
Expand Down Expand Up @@ -51,14 +52,15 @@ class ExecutionContext

/**
* ExecutionContext constructor.
* @param Schema $schema
* @param array $fragments
* @param $rootValue
* @param $contextValue
* @param $variableValues
* @param $fieldResolver
*
* @param Schema $schema
* @param array $fragments
* @param $rootValue
* @param $contextValue
* @param $variableValues
* @param $fieldResolver
* @param OperationDefinitionNode $operatgion
* @param array $errors
* @param array $errors
*/
public function __construct(
Schema $schema,
Expand All @@ -68,8 +70,8 @@ public function __construct(
$variableValues,
$fieldResolver,
OperationDefinitionNode $operation,
array $errors)
{
array $errors
) {
$this->schema = $schema;
$this->fragments = $fragments;
$this->rootValue = $rootValue;
Expand All @@ -80,7 +82,6 @@ public function __construct(
$this->errors = $errors;
}


/**
* @return OperationDefinitionNode
*/
Expand Down
4 changes: 3 additions & 1 deletion src/Execution/ExecutionResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class ExecutionResult
{

/**
* @var GraphQLError[]
*/
Expand All @@ -18,7 +19,8 @@ class ExecutionResult

/**
* ExecutionResult constructor.
* @param mixed[] $data
*
* @param mixed[] $data
* @param GraphQLError[] $errors
*/
public function __construct(array $data, array $errors)
Expand Down
47 changes: 23 additions & 24 deletions src/Execution/ExecutionStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@

/**
* Class AbstractStrategy
*
* @package Digia\GraphQL\Execution\Strategies
*/
abstract class ExecutionStrategy
{

/**
* @var ExecutionContext
*/
Expand All @@ -35,15 +37,15 @@ abstract class ExecutionStrategy

/**
* AbstractStrategy constructor.
* @param ExecutionContext $context
*
* @param ExecutionContext $context
* @param OperationDefinitionNode $operation
*/
public function __construct(
ExecutionContext $context,
OperationDefinitionNode $operation,
$rootValue)
{
$rootValue
) {
$this->context = $context;
$this->operation = $operation;
$this->rootValue = $rootValue;
Expand All @@ -55,10 +57,10 @@ public function __construct(
abstract function execute(): ?array;

/**
* @param ObjectType $runtimeType
* @param ObjectType $runtimeType
* @param SelectionSetNode $selectionSet
* @param $fields
* @param $visitedFragmentNames
* @param $fields
* @param $visitedFragmentNames
* @return \ArrayObject
*/
protected function collectFields(
Expand Down Expand Up @@ -110,21 +112,20 @@ protected function collectFields(
/**
* Implements the "Evaluating selection sets" section of the spec
* for "read" mode.
* @param ObjectType $parentType
* @param $source
* @param $path
* @param $fields
*
* @param ObjectType $parentType
* @param $source
* @param $path
* @param $fields
* @return array
*
* @throws GraphQLError|\Exception
*/
protected function executeFields(
ObjectType $parentType,
$source,
$path,
$fields): array
{
$fields
): array {
$finalResults = [];

foreach ($fields as $fieldName => $fieldNodes) {
Expand All @@ -148,31 +149,29 @@ protected function executeFields(

/**
* @param ObjectType $parentType
* @param string $fieldName
* @param string $fieldName
* @return bool
* @throws \Exception
*/
protected function isDefinedField(ObjectType $parentType, string $fieldName)
{
return isset($parentType->getFields()[$fieldName]);
return isset($parentType->getFields()[$fieldName]);
}

/**
* @param ObjectType $parentType
* @param $source
* @param $fieldNodes
* @param $path
*
* @param $source
* @param $fieldNodes
* @param $path
* @return mixed
*
* @throws GraphQLError|\Exception
*/
protected function resolveField(
ObjectType $parentType,
$source,
$fieldNodes,
$path)
{
$path
) {
/** @var FieldNode $fieldNode */
$fieldNode = $fieldNodes[0];

Expand Down Expand Up @@ -202,8 +201,8 @@ private function completeValue(
$fieldNodes,
$info,
$path,
&$result)
{
&$result
) {


}
Expand Down
3 changes: 2 additions & 1 deletion src/Execution/ExecutorExecutionStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ function execute(): ?array
? $schema->getMutation()
: $schema->getQuery();

$fields = $this->collectFields($objectType, $this->operation->getSelectionSet(), new \ArrayObject(), new \ArrayObject());
$fields = $this->collectFields($objectType, $this->operation->getSelectionSet(), new \ArrayObject(),
new \ArrayObject());
$path = [];

try {
Expand Down
2 changes: 0 additions & 2 deletions src/Language/AST/Builder/AbstractBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Digia\GraphQL\Language\AST\Builder;

use Digia\GraphQL\Language\AST\Builder\BuilderInterface;
use Digia\GraphQL\Language\AST\Builder\DirectorInterface;
use Digia\GraphQL\Language\Location;

abstract class AbstractBuilder implements BuilderInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Language/AST/Builder/DirectiveBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Digia\GraphQL\Language\AST\Builder;

use Digia\GraphQL\Language\AST\Node\NodeInterface;
use Digia\GraphQL\Language\AST\Node\DirectiveNode;
use Digia\GraphQL\Language\AST\Node\NodeInterface;
use Digia\GraphQL\Language\AST\NodeKindEnum;

class DirectiveBuilder extends AbstractBuilder
Expand Down
2 changes: 1 addition & 1 deletion src/Language/AST/Builder/DirectiveDefinitionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Digia\GraphQL\Language\AST\Builder;

use Digia\GraphQL\Language\AST\Node\NodeInterface;
use Digia\GraphQL\Language\AST\Node\DirectiveDefinitionNode;
use Digia\GraphQL\Language\AST\Node\NodeInterface;
use Digia\GraphQL\Language\AST\NodeKindEnum;

class DirectiveDefinitionBuilder extends AbstractBuilder
Expand Down
3 changes: 1 addition & 2 deletions src/Language/AST/Builder/DocumentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

namespace Digia\GraphQL\Language\AST\Builder;

use Digia\GraphQL\Language\AST\Node\DefinitionNodeInterface;
use Digia\GraphQL\Language\AST\Node\NodeInterface;
use Digia\GraphQL\Language\AST\Node\DocumentNode;
use Digia\GraphQL\Language\AST\Node\NodeInterface;
use Digia\GraphQL\Language\AST\NodeKindEnum;

class DocumentBuilder extends AbstractBuilder
Expand Down
3 changes: 1 addition & 2 deletions src/Language/AST/Builder/EnumBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

namespace Digia\GraphQL\Language\AST\Builder;

use Digia\GraphQL\Language\AST\Node\NodeInterface;
use Digia\GraphQL\Language\AST\Node\EnumValueNode;
use Digia\GraphQL\Language\AST\Node\IntValueNode;
use Digia\GraphQL\Language\AST\Node\NodeInterface;
use Digia\GraphQL\Language\AST\NodeKindEnum;

class EnumBuilder extends AbstractBuilder
Expand Down
2 changes: 1 addition & 1 deletion src/Language/AST/Builder/EnumTypeDefinitionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Digia\GraphQL\Language\AST\Builder;

use Digia\GraphQL\Language\AST\Node\NodeInterface;
use Digia\GraphQL\Language\AST\Node\EnumTypeDefinitionNode;
use Digia\GraphQL\Language\AST\Node\NodeInterface;
use Digia\GraphQL\Language\AST\NodeKindEnum;

class EnumTypeDefinitionBuilder extends AbstractBuilder
Expand Down
2 changes: 1 addition & 1 deletion src/Language/AST/Builder/EnumTypeExtensionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Digia\GraphQL\Language\AST\Builder;

use Digia\GraphQL\Language\AST\Node\NodeInterface;
use Digia\GraphQL\Language\AST\Node\EnumTypeExtensionNode;
use Digia\GraphQL\Language\AST\Node\NodeInterface;
use Digia\GraphQL\Language\AST\NodeKindEnum;

class EnumTypeExtensionBuilder extends AbstractBuilder
Expand Down

0 comments on commit dae3c49

Please sign in to comment.