@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | { |
179 | 179 | $commentReplies = isset(self::$commentReplies[$commentId]) ? self::$commentReplies[$commentId] : []; |
180 | 180 | |
181 | - $start = isset($after) ? (int) array_search($afterId, $commentReplies) + 1: 0; |
|
181 | + $start = isset($after) ? (int) array_search($afterId, $commentReplies) + 1 : 0; |
|
182 | 182 | $commentReplies = array_slice($commentReplies, $start, $limit); |
183 | 183 | |
184 | 184 | return array_map( |
@@ -201,6 +201,6 @@ discard block |
||
201 | 201 | |
202 | 202 | public static function findStoryMentions($storyId) |
203 | 203 | { |
204 | - return isset(self::$storyMentions[$storyId]) ? self::$storyMentions[$storyId] :[]; |
|
204 | + return isset(self::$storyMentions[$storyId]) ? self::$storyMentions[$storyId] : []; |
|
205 | 205 | } |
206 | 206 | } |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use GraphQL\Utils\Utils; |
5 | 5 | |
6 | -$outputFile = __DIR__ . '/../docs/reference.md'; |
|
6 | +$outputFile = __DIR__ . '/../docs/reference.md'; |
|
7 | 7 | |
8 | 8 | $entries = [ |
9 | 9 | \GraphQL\GraphQL::class, |
@@ -56,7 +56,7 @@ |
||
56 | 56 | { |
57 | 57 | if ($this->typeIndex > $this->config['totalTypes']) { |
58 | 58 | throw new \Exception( |
59 | - "Cannot create new type: there are already {$this->typeIndex} ". |
|
59 | + "Cannot create new type: there are already {$this->typeIndex} " . |
|
60 | 60 | "which exceeds allowed number of {$this->config['totalTypes']} types total" |
61 | 61 | ); |
62 | 62 | } |
@@ -74,7 +74,7 @@ |
||
74 | 74 | if (is_array($config)) { |
75 | 75 | $config = ServerConfig::create($config); |
76 | 76 | } |
77 | - if (! $config instanceof ServerConfig) { |
|
77 | + if (!$config instanceof ServerConfig) { |
|
78 | 78 | throw new InvariantViolation('Expecting valid server config, but got ' . Utils::printSafe($config)); |
79 | 79 | } |
80 | 80 | $this->config = $config; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $instance = new static(); |
44 | 44 | foreach ($config as $key => $value) { |
45 | 45 | $method = 'set' . ucfirst($key); |
46 | - if (! method_exists($instance, $method)) { |
|
46 | + if (!method_exists($instance, $method)) { |
|
47 | 47 | throw new InvariantViolation(sprintf('Unknown server config option "%s"', $key)); |
48 | 48 | } |
49 | 49 | $instance->$method($value); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function setValidationRules($validationRules) |
157 | 157 | { |
158 | - if (! is_callable($validationRules) && ! is_array($validationRules) && $validationRules !== null) { |
|
158 | + if (!is_callable($validationRules) && !is_array($validationRules) && $validationRules !== null) { |
|
159 | 159 | throw new InvariantViolation( |
160 | 160 | 'Server config expects array of validation rules or callable returning such array, but got ' . |
161 | 161 | Utils::printSafe($validationRules) |
@@ -22,10 +22,10 @@ discard block |
||
22 | 22 | |
23 | 23 | return [ |
24 | 24 | NodeKind::OPERATION_DEFINITION => [ |
25 | - 'enter' => function () { |
|
25 | + 'enter' => function() { |
|
26 | 26 | $this->variableDefs = []; |
27 | 27 | }, |
28 | - 'leave' => function (OperationDefinitionNode $operation) use ($context) { |
|
28 | + 'leave' => function(OperationDefinitionNode $operation) use ($context) { |
|
29 | 29 | $variableNameUsed = []; |
30 | 30 | $usages = $context->getRecursiveVariableUsages($operation); |
31 | 31 | $opName = $operation->name ? $operation->name->value : null; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | foreach ($this->variableDefs as $variableDef) { |
39 | 39 | $variableName = $variableDef->variable->name->value; |
40 | 40 | |
41 | - if (! empty($variableNameUsed[$variableName])) { |
|
41 | + if (!empty($variableNameUsed[$variableName])) { |
|
42 | 42 | continue; |
43 | 43 | } |
44 | 44 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | }, |
51 | 51 | ], |
52 | - NodeKind::VARIABLE_DEFINITION => function ($def) { |
|
52 | + NodeKind::VARIABLE_DEFINITION => function($def) { |
|
53 | 53 | $this->variableDefs[] = $def; |
54 | 54 | }, |
55 | 55 | ]; |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | public function getVisitor(ValidationContext $context) |
24 | 24 | { |
25 | 25 | return [ |
26 | - NodeKind::INLINE_FRAGMENT => function (InlineFragmentNode $node) use ($context) { |
|
26 | + NodeKind::INLINE_FRAGMENT => function(InlineFragmentNode $node) use ($context) { |
|
27 | 27 | $fragType = $context->getType(); |
28 | 28 | $parentType = $context->getParentType(); |
29 | 29 | |
30 | - if (! ($fragType instanceof CompositeType) || |
|
31 | - ! ($parentType instanceof CompositeType) || |
|
30 | + if (!($fragType instanceof CompositeType) || |
|
31 | + !($parentType instanceof CompositeType) || |
|
32 | 32 | $this->doTypesOverlap($context->getSchema(), $fragType, $parentType)) { |
33 | 33 | return; |
34 | 34 | } |
@@ -38,13 +38,13 @@ discard block |
||
38 | 38 | [$node] |
39 | 39 | )); |
40 | 40 | }, |
41 | - NodeKind::FRAGMENT_SPREAD => function (FragmentSpreadNode $node) use ($context) { |
|
41 | + NodeKind::FRAGMENT_SPREAD => function(FragmentSpreadNode $node) use ($context) { |
|
42 | 42 | $fragName = $node->name->value; |
43 | 43 | $fragType = $this->getFragmentType($context, $fragName); |
44 | 44 | $parentType = $context->getParentType(); |
45 | 45 | |
46 | - if (! $fragType || |
|
47 | - ! $parentType || |
|
46 | + if (!$fragType || |
|
47 | + !$parentType || |
|
48 | 48 | $this->doTypesOverlap($context->getSchema(), $fragType, $parentType) |
49 | 49 | ) { |
50 | 50 | return; |
@@ -21,10 +21,10 @@ |
||
21 | 21 | $this->knownVariableNames = []; |
22 | 22 | |
23 | 23 | return [ |
24 | - NodeKind::OPERATION_DEFINITION => function () { |
|
24 | + NodeKind::OPERATION_DEFINITION => function() { |
|
25 | 25 | $this->knownVariableNames = []; |
26 | 26 | }, |
27 | - NodeKind::VARIABLE_DEFINITION => function (VariableDefinitionNode $node) use ($context) { |
|
27 | + NodeKind::VARIABLE_DEFINITION => function(VariableDefinitionNode $node) use ($context) { |
|
28 | 28 | $variableName = $node->variable->name->value; |
29 | 29 | if (empty($this->knownVariableNames[$variableName])) { |
30 | 30 | $this->knownVariableNames[$variableName] = $node->variable->name; |
@@ -27,18 +27,18 @@ |
||
27 | 27 | |
28 | 28 | return [ |
29 | 29 | NodeKind::OBJECT => [ |
30 | - 'enter' => function () { |
|
30 | + 'enter' => function() { |
|
31 | 31 | $this->knownNameStack[] = $this->knownNames; |
32 | 32 | $this->knownNames = []; |
33 | 33 | }, |
34 | - 'leave' => function () { |
|
34 | + 'leave' => function() { |
|
35 | 35 | $this->knownNames = array_pop($this->knownNameStack); |
36 | 36 | }, |
37 | 37 | ], |
38 | - NodeKind::OBJECT_FIELD => function (ObjectFieldNode $node) use ($context) { |
|
38 | + NodeKind::OBJECT_FIELD => function(ObjectFieldNode $node) use ($context) { |
|
39 | 39 | $fieldName = $node->name->value; |
40 | 40 | |
41 | - if (! empty($this->knownNames[$fieldName])) { |
|
41 | + if (!empty($this->knownNames[$fieldName])) { |
|
42 | 42 | $context->reportError(new Error( |
43 | 43 | self::duplicateInputFieldMessage($fieldName), |
44 | 44 | [$this->knownNames[$fieldName], $node->name] |