@@ -81,7 +81,7 @@ |
||
81 | 81 | $this->schema = $schema; |
82 | 82 | $this->getFieldDefinitionFunction = null !== $getFieldDefinitionFunction |
83 | 83 | ? $getFieldDefinitionFunction |
84 | - : function ( |
|
84 | + : function( |
|
85 | 85 | SchemaInterface $schema, |
86 | 86 | TypeInterface $parentType, |
87 | 87 | FieldNode $fieldNode |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | return $count === 1 |
39 | 39 | ? $selected[0] |
40 | 40 | : \array_reduce($selected, |
41 | - function ($list, $item) use ($count, &$index) { |
|
42 | - $list .= ($index > 0 && $index < ($count - 1) ? ', ' : '').($index === ($count - 1) ? ' or ' : ''). |
|
41 | + function($list, $item) use ($count, &$index) { |
|
42 | + $list .= ($index > 0 && $index < ($count - 1) ? ', ' : '') . ($index === ($count - 1) ? ' or ' : '') . |
|
43 | 43 | $item; |
44 | 44 | $index++; |
45 | 45 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | $result = \array_keys($optionsByDistance); |
77 | 77 | |
78 | - \usort($result, function ($a, $b) use ($optionsByDistance) { |
|
78 | + \usort($result, function($a, $b) use ($optionsByDistance) { |
|
79 | 79 | return $optionsByDistance[$a] - $optionsByDistance[$b]; |
80 | 80 | }); |
81 | 81 | |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | */ |
92 | 92 | function quotedOrList(array $items): string |
93 | 93 | { |
94 | - return orList(array_map(function ($item) { |
|
95 | - return '"'.$item.'"'; |
|
94 | + return orList(array_map(function($item) { |
|
95 | + return '"' . $item . '"'; |
|
96 | 96 | }, $items)); |
97 | 97 | } |
98 | 98 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | function arrayEvery(array $array, callable $fn): bool |
107 | 107 | { |
108 | - return array_reduce($array, function ($result, $value) use ($fn) { |
|
108 | + return array_reduce($array, function($result, $value) use ($fn) { |
|
109 | 109 | return $result && $fn($value); |
110 | 110 | }, true); |
111 | 111 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | */ |
119 | 119 | function arraySome(array $array, callable $fn) |
120 | 120 | { |
121 | - return array_reduce($array, function ($result, $value) use ($fn) { |
|
121 | + return array_reduce($array, function($result, $value) use ($fn) { |
|
122 | 122 | return $result || $fn($value); |
123 | 123 | }); |
124 | 124 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | function keyMap(array $array, callable $keyFn): array |
150 | 150 | { |
151 | - return array_reduce($array, function ($map, $item) use ($keyFn) { |
|
151 | + return array_reduce($array, function($map, $item) use ($keyFn) { |
|
152 | 152 | $map[$keyFn($item)] = $item; |
153 | 153 | |
154 | 154 | return $map; |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | function keyValueMap(array $array, callable $keyFn, callable $valFn): array |
166 | 166 | { |
167 | - return array_reduce($array, function ($map, $item) use ($keyFn, $valFn) { |
|
167 | + return array_reduce($array, function($map, $item) use ($keyFn, $valFn) { |
|
168 | 168 | $map[$keyFn($item)] = $valFn($item); |
169 | 169 | |
170 | 170 | return $map; |
@@ -30,7 +30,7 @@ |
||
30 | 30 | protected function setConfig(array $config) |
31 | 31 | { |
32 | 32 | foreach ($config as $key => $value) { |
33 | - $setter = 'set'.ucfirst($key); |
|
33 | + $setter = 'set' . ucfirst($key); |
|
34 | 34 | if (method_exists($this, $setter)) { |
35 | 35 | $this->$setter($value); |
36 | 36 | } elseif (property_exists($this, $key)) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $argumentNodes = $node->getArguments(); |
38 | 38 | $argumentNodeMap = keyMap($argumentNodes, |
39 | - function (ArgumentNode $argument) { |
|
39 | + function(ArgumentNode $argument) { |
|
40 | 40 | return $argument->getNameValue(); |
41 | 41 | }); |
42 | 42 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $argumentNodes = $node->getArguments(); |
76 | 76 | $argumentNodeMap = keyMap($argumentNodes, |
77 | - function (ArgumentNode $argument) { |
|
77 | + function(ArgumentNode $argument) { |
|
78 | 78 | return $argument->getNameValue(); |
79 | 79 | }); |
80 | 80 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | ): ?NodeInterface |
30 | 30 | { |
31 | 31 | $this->validateFragementNode($node, |
32 | - function (FragmentDefinitionNode $node) { |
|
32 | + function(FragmentDefinitionNode $node) { |
|
33 | 33 | return fragmentOnNonCompositeMessage((string)$node, |
34 | 34 | (string)$node->getTypeCondition()); |
35 | 35 | }); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | ): ?NodeInterface |
71 | 71 | { |
72 | 72 | $this->validateFragementNode($node, |
73 | - function (InlineFragmentNode $node) { |
|
73 | + function(InlineFragmentNode $node) { |
|
74 | 74 | return inlineFragmentOnNonCompositeMessage((string)$node->getTypeCondition()); |
75 | 75 | }); |
76 | 76 |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | { |
155 | 155 | if ($type instanceof EnumType) { |
156 | 156 | $suggestions = suggestionList(printNode($node), |
157 | - \array_map(function (EnumValue $value) { |
|
157 | + \array_map(function(EnumValue $value) { |
|
158 | 158 | return $value->getName(); |
159 | 159 | }, $type->getValues())); |
160 | 160 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | // Ensure every required field exists. |
210 | 210 | $inputFields = $type->getFields(); |
211 | 211 | $fieldNodeMap = keyMap($node->getFields(), |
212 | - function (ObjectFieldNode $field) { |
|
212 | + function(ObjectFieldNode $field) { |
|
213 | 213 | return $field->getNameValue(); |
214 | 214 | }); |
215 | 215 |
@@ -111,7 +111,7 @@ |
||
111 | 111 | $suggestedInterfaceTypes = \array_keys($interfaceUsageCount); |
112 | 112 | |
113 | 113 | \uasort($suggestedInterfaceTypes, |
114 | - function ($a, $b) use ($interfaceUsageCount) { |
|
114 | + function($a, $b) use ($interfaceUsageCount) { |
|
115 | 115 | return $interfaceUsageCount[$b] - $interfaceUsageCount[$a]; |
116 | 116 | }); |
117 | 117 |
@@ -106,7 +106,7 @@ |
||
106 | 106 | $this->context->reportError( |
107 | 107 | new ValidationException( |
108 | 108 | fragmentCycleMessage($spreadName, |
109 | - \array_map(function (FragmentSpreadNode $spread) { |
|
109 | + \array_map(function(FragmentSpreadNode $spread) { |
|
110 | 110 | return $spread->getNameValue(); |
111 | 111 | }, $cyclePath)), |
112 | 112 | \array_merge($cyclePath, [$spreadNode]) |
@@ -28,7 +28,7 @@ |
||
28 | 28 | protected function enterDocument(DocumentNode $node): ?NodeInterface |
29 | 29 | { |
30 | 30 | $this->operationCount = \count(\array_filter($node->getDefinitions(), |
31 | - function ($definition) { |
|
31 | + function($definition) { |
|
32 | 32 | return $definition instanceof OperationDefinitionNode; |
33 | 33 | })); |
34 | 34 |