@@ -66,7 +66,7 @@ |
||
66 | 66 | $array = ['data' => $this->data]; |
67 | 67 | |
68 | 68 | if (!empty($this->errors)) { |
69 | - $array['errors'] = array_map(function (GraphQLException $error) { |
|
69 | + $array['errors'] = array_map(function(GraphQLException $error) { |
|
70 | 70 | return $error->toArray(); |
71 | 71 | }, $this->errors); |
72 | 72 | } |
@@ -124,7 +124,7 @@ |
||
124 | 124 | { |
125 | 125 | return arraySome( |
126 | 126 | introspectionTypes(), |
127 | - function (TypeInterface $introspectionType) use ($type) { |
|
127 | + function(TypeInterface $introspectionType) use ($type) { |
|
128 | 128 | /** @noinspection PhpUndefinedMethodInspection */ |
129 | 129 | return $type->getName() === $introspectionType->getName(); |
130 | 130 | } |
@@ -92,7 +92,7 @@ |
||
92 | 92 | // If both types are abstract, then determine if there is any intersection |
93 | 93 | // between possible concrete types of each. |
94 | 94 | return arraySome($schema->getPossibleTypes($typeA), |
95 | - function (TypeInterface $type) use ($schema, $typeB) { |
|
95 | + function(TypeInterface $type) use ($schema, $typeB) { |
|
96 | 96 | return $schema->isPossibleType($typeB, $type); |
97 | 97 | }); |
98 | 98 | } |
@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | $context = $this->createContext($schema, $document, $typeInfo); |
48 | 48 | |
49 | - $visitors = \array_map(function (RuleInterface $rule) use ($context) { |
|
49 | + $visitors = \array_map(function(RuleInterface $rule) use ($context) { |
|
50 | 50 | return $rule->setContext($context); |
51 | 51 | }, $rules); |
52 | 52 |
@@ -31,7 +31,7 @@ |
||
31 | 31 | ->withArgument(ASTBuilderInterface::class) |
32 | 32 | ->withArgument(NodeBuilderInterface::class); |
33 | 33 | |
34 | - $this->container->add(LexerInterface::class, function () { |
|
34 | + $this->container->add(LexerInterface::class, function() { |
|
35 | 35 | return new Lexer(SupportedReaders::get()); |
36 | 36 | }); |
37 | 37 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $parentType = $this->context->getParentType(); |
55 | 55 | |
56 | 56 | if (null !== $fieldDefinition && null !== $parentType) { |
57 | - $options = array_map(function (Argument $argument) { |
|
57 | + $options = array_map(function(Argument $argument) { |
|
58 | 58 | return $argument->getName(); |
59 | 59 | }, $fieldDefinition->getArguments()); |
60 | 60 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $directive = $this->context->getDirective(); |
84 | 84 | |
85 | 85 | if (null !== $directive) { |
86 | - $options = array_map(function (Argument $argument) { |
|
86 | + $options = array_map(function(Argument $argument) { |
|
87 | 87 | return $argument->getName(); |
88 | 88 | }, $directive->getArguments()); |
89 | 89 |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | ? (!empty($nodes) ? $nodes : []) |
114 | 114 | : (null !== $nodes ? [$nodes] : []); |
115 | 115 | |
116 | - $this->nodes = \array_filter($nodes, function ($node) { |
|
116 | + $this->nodes = \array_filter($nodes, function($node) { |
|
117 | 117 | return null !== $node; |
118 | 118 | }); |
119 | 119 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | { |
148 | 148 | if (null === $positions && !empty($this->nodes)) { |
149 | 149 | $positions = array_reduce($this->nodes, |
150 | - function (array $list, ?NodeInterface $node) { |
|
150 | + function(array $list, ?NodeInterface $node) { |
|
151 | 151 | if (null !== $node) { |
152 | 152 | $location = $node->getLocation(); |
153 | 153 | if (null !== $location) { |
@@ -177,12 +177,12 @@ discard block |
||
177 | 177 | protected function resolveLocations(?array $positions, ?Source $source) |
178 | 178 | { |
179 | 179 | if (null !== $positions && null !== $source) { |
180 | - $locations = array_map(function ($position) use ($source) { |
|
180 | + $locations = array_map(function($position) use ($source) { |
|
181 | 181 | return SourceLocation::fromSource($source, $position); |
182 | 182 | }, $positions); |
183 | 183 | } elseif (!empty($this->nodes)) { |
184 | 184 | $locations = array_reduce($this->nodes, |
185 | - function (array $list, NodeInterface $node) { |
|
185 | + function(array $list, NodeInterface $node) { |
|
186 | 186 | $location = $node->getLocation(); |
187 | 187 | if (null !== $location) { |
188 | 188 | $list[] = SourceLocation::fromSource($location->getSource(), |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | */ |
290 | 290 | public function getLocationsAsArray(): ?array |
291 | 291 | { |
292 | - return !empty($this->locations) ? array_map(function ( |
|
292 | + return !empty($this->locations) ? array_map(function( |
|
293 | 293 | SourceLocation $location |
294 | 294 | ) { |
295 | 295 | return $location->toArray(); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | return empty($printedLocations) |
59 | 59 | ? $error->getMessage() |
60 | 60 | : \implode("\n\n", |
61 | - \array_merge([$error->getMessage()], $printedLocations))."\n"; |
|
61 | + \array_merge([$error->getMessage()], $printedLocations)) . "\n"; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -82,19 +82,19 @@ discard block |
||
82 | 82 | $nextLineNum = (string)($contextLine + 1); |
83 | 83 | $padLen = \mb_strlen($nextLineNum); |
84 | 84 | $lines = \preg_split("/\r\n|[\n\r]/", $source->getBody()); |
85 | - $lines[0] = whitespace($locationOffset->getColumn() - 1).$lines[0]; |
|
85 | + $lines[0] = whitespace($locationOffset->getColumn() - 1) . $lines[0]; |
|
86 | 86 | $outputLines = [ |
87 | 87 | \sprintf('%s (%s:%s)', $source->getName(), $contextLine, |
88 | 88 | $contextColumn), |
89 | 89 | $line >= 2 ? leftPad($padLen, |
90 | - $prevLineNum).': '.$lines[$line - 2] : null, |
|
91 | - leftPad($padLen, $lineNum).': '.$lines[$line - 1], |
|
92 | - whitespace(2 + $padLen + $contextColumn - 1).'^', |
|
90 | + $prevLineNum) . ': ' . $lines[$line - 2] : null, |
|
91 | + leftPad($padLen, $lineNum) . ': ' . $lines[$line - 1], |
|
92 | + whitespace(2 + $padLen + $contextColumn - 1) . '^', |
|
93 | 93 | $line < \count($lines) ? leftPad($padLen, |
94 | - $nextLineNum).': '.$lines[$line] : null, |
|
94 | + $nextLineNum) . ': ' . $lines[$line] : null, |
|
95 | 95 | ]; |
96 | 96 | |
97 | - return \implode("\n", \array_filter($outputLines, function ($line) { |
|
97 | + return \implode("\n", \array_filter($outputLines, function($line) { |
|
98 | 98 | return null !== $line; |
99 | 99 | })); |
100 | 100 | } |
@@ -129,5 +129,5 @@ discard block |
||
129 | 129 | */ |
130 | 130 | function leftPad(int $length, string $str): string |
131 | 131 | { |
132 | - return whitespace($length - \mb_strlen($str)).$str; |
|
132 | + return whitespace($length - \mb_strlen($str)) . $str; |
|
133 | 133 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function buildTypes(): array |
83 | 83 | { |
84 | - return \array_map(function (TypeDefinitionNodeInterface $definition) { |
|
84 | + return \array_map(function(TypeDefinitionNodeInterface $definition) { |
|
85 | 85 | return $this->definitionBuilder->buildType($definition); |
86 | 86 | }, \array_values($this->info->getTypeDefinitionMap())); |
87 | 87 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function buildDirectives(): array |
93 | 93 | { |
94 | - $directives = \array_map(function (DirectiveDefinitionNode $definition |
|
94 | + $directives = \array_map(function(DirectiveDefinitionNode $definition |
|
95 | 95 | ) { |
96 | 96 | return $this->definitionBuilder->buildDirective($definition); |
97 | 97 | }, $this->info->getDirectiveDefinitions()); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | foreach ($specifiedDirectivesMap as $name => $directive) { |
106 | 106 | if (!arraySome($directives, |
107 | - function (Directive $directive) use ($name) { |
|
107 | + function(Directive $directive) use ($name) { |
|
108 | 108 | return $directive->getName() === $name; |
109 | 109 | })) { |
110 | 110 | $directives[] = $directive; |