@@ -32,7 +32,7 @@ |
||
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
35 | - * @param Source|string $doc |
|
35 | + * @param string $doc |
|
36 | 36 | * |
37 | 37 | * @return mixed[] |
38 | 38 | */ |
@@ -82,6 +82,10 @@ discard block |
||
82 | 82 | self::assertValidPromise($promise, null, 'A', SyncPromise::FULFILLED); |
83 | 83 | } |
84 | 84 | |
85 | + /** |
|
86 | + * @param Promise $promise |
|
87 | + * @param null|string $expectedNextReason |
|
88 | + */ |
|
85 | 89 | private static function assertValidPromise($promise, $expectedNextReason, $expectedNextValue, $expectedNextState) |
86 | 90 | { |
87 | 91 | self::assertInstanceOf('GraphQL\Executor\Promise\Promise', $promise); |
@@ -93,10 +97,18 @@ discard block |
||
93 | 97 | $onRejectedCalled = false; |
94 | 98 | |
95 | 99 | $promise->then( |
100 | + |
|
101 | + /** |
|
102 | + * @param Promise $nextValue |
|
103 | + */ |
|
96 | 104 | static function ($nextValue) use (&$actualNextValue, &$onFulfilledCalled) { |
97 | 105 | $onFulfilledCalled = true; |
98 | 106 | $actualNextValue = $nextValue; |
99 | 107 | }, |
108 | + |
|
109 | + /** |
|
110 | + * @param Promise $reason |
|
111 | + */ |
|
100 | 112 | static function (Throwable $reason) use (&$actualNextReason, &$onRejectedCalled) { |
101 | 113 | $onRejectedCalled = true; |
102 | 114 | $actualNextReason = $reason->getMessage(); |
@@ -109,6 +109,9 @@ |
||
109 | 109 | ); |
110 | 110 | } |
111 | 111 | |
112 | + /** |
|
113 | + * @param string $query |
|
114 | + */ |
|
112 | 115 | private function executeQuery($query, $variableValues = null) |
113 | 116 | { |
114 | 117 | $document = Parser::parse($query); |
@@ -149,6 +149,11 @@ discard block |
||
149 | 149 | Parser::parse('query Foo($x: Boolean = false @bar) { field }'); |
150 | 150 | } |
151 | 151 | |
152 | + /** |
|
153 | + * @param string $text |
|
154 | + * @param string $message |
|
155 | + * @param SourceLocation $location |
|
156 | + */ |
|
152 | 157 | private function expectSyntaxError($text, $message, $location) |
153 | 158 | { |
154 | 159 | $this->expectException(SyntaxError::class); |
@@ -161,6 +166,10 @@ discard block |
||
161 | 166 | } |
162 | 167 | } |
163 | 168 | |
169 | + /** |
|
170 | + * @param integer $line |
|
171 | + * @param integer $column |
|
172 | + */ |
|
164 | 173 | private function loc($line, $column) |
165 | 174 | { |
166 | 175 | return new SourceLocation($line, $column); |
@@ -107,6 +107,9 @@ |
||
107 | 107 | ]); |
108 | 108 | } |
109 | 109 | |
110 | + /** |
|
111 | + * @param DocumentNode $ast |
|
112 | + */ |
|
110 | 113 | private function checkVisitorFnArgs($ast, $args, $isEdited = false) |
111 | 114 | { |
112 | 115 | /** @var Node $node */ |
@@ -44,6 +44,9 @@ discard block |
||
44 | 44 | $this->assertQueryResultEquals($expected, $query); |
45 | 45 | } |
46 | 46 | |
47 | + /** |
|
48 | + * @param string $query |
|
49 | + */ |
|
47 | 50 | private function assertQueryResultEquals($expected, $query, $variables = null) |
48 | 51 | { |
49 | 52 | $result = $this->executeQuery($query, $variables); |
@@ -267,6 +270,9 @@ discard block |
||
267 | 270 | self::assertEquals($expected, $result->toArray()); |
268 | 271 | } |
269 | 272 | |
273 | + /** |
|
274 | + * @param string $queryId |
|
275 | + */ |
|
270 | 276 | private function executePersistedQuery($queryId, $variables = null) |
271 | 277 | { |
272 | 278 | $op = OperationParams::create(['queryId' => $queryId, 'variables' => $variables]); |
@@ -38,6 +38,9 @@ discard block |
||
38 | 38 | self::assertEquals($expected, $result->toArray(true)); |
39 | 39 | } |
40 | 40 | |
41 | + /** |
|
42 | + * @param string $contentType |
|
43 | + */ |
|
41 | 44 | private function parseRawRequest($contentType, $content, $method = 'POST') |
42 | 45 | { |
43 | 46 | $_SERVER['CONTENT_TYPE'] = $contentType; |
@@ -62,6 +65,9 @@ discard block |
||
62 | 65 | $this->assertPsrRequestEquals($expected, $request); |
63 | 66 | } |
64 | 67 | |
68 | + /** |
|
69 | + * @param string $contentType |
|
70 | + */ |
|
65 | 71 | private function preparePsrRequest($contentType, $parsedBody) |
66 | 72 | { |
67 | 73 | $psrRequest = new PsrRequestStub(); |
@@ -72,6 +78,9 @@ discard block |
||
72 | 78 | return $psrRequest; |
73 | 79 | } |
74 | 80 | |
81 | + /** |
|
82 | + * @param PsrRequestStub $request |
|
83 | + */ |
|
75 | 84 | private function assertPsrRequestEquals($expected, $request) |
76 | 85 | { |
77 | 86 | $result = $this->executePsrRequest($request); |
@@ -237,6 +237,9 @@ |
||
237 | 237 | ); |
238 | 238 | } |
239 | 239 | |
240 | + /** |
|
241 | + * @param string $query |
|
242 | + */ |
|
240 | 243 | private function expectFailure($query, $vars, $err) |
241 | 244 | { |
242 | 245 | $result = GraphQL::executeQuery($this->schema, $query, null, null, $vars); |
@@ -138,24 +138,39 @@ discard block |
||
138 | 138 | Warning::suppress(Warning::WARNING_NOT_A_TYPE); |
139 | 139 | } |
140 | 140 | |
141 | + /** |
|
142 | + * @param InputObjectType[] $types |
|
143 | + */ |
|
141 | 144 | private function withModifiers($types) |
142 | 145 | { |
143 | 146 | return array_merge( |
144 | 147 | $types, |
145 | 148 | Utils::map( |
146 | 149 | $types, |
150 | + |
|
151 | + /** |
|
152 | + * @param InputObjectType[] $type |
|
153 | + */ |
|
147 | 154 | static function ($type) { |
148 | 155 | return Type::listOf($type); |
149 | 156 | } |
150 | 157 | ), |
151 | 158 | Utils::map( |
152 | 159 | $types, |
160 | + |
|
161 | + /** |
|
162 | + * @param InputObjectType[] $type |
|
163 | + */ |
|
153 | 164 | static function ($type) { |
154 | 165 | return Type::nonNull($type); |
155 | 166 | } |
156 | 167 | ), |
157 | 168 | Utils::map( |
158 | 169 | $types, |
170 | + |
|
171 | + /** |
|
172 | + * @param InputObjectType[] $type |
|
173 | + */ |
|
159 | 174 | static function ($type) { |
160 | 175 | return Type::nonNull(Type::listOf($type)); |
161 | 176 | } |
@@ -195,6 +210,8 @@ discard block |
||
195 | 210 | |
196 | 211 | /** |
197 | 212 | * DESCRIBE: Type System: A Schema must have Object root types |
213 | + * @param \Closure[] $closures |
|
214 | + * @param string $expectedError |
|
198 | 215 | */ |
199 | 216 | private function assertEachCallableThrows($closures, $expectedError) |
200 | 217 | { |
@@ -360,6 +377,9 @@ discard block |
||
360 | 377 | }); |
361 | 378 | } |
362 | 379 | |
380 | + /** |
|
381 | + * @param InvariantViolation[] $errors |
|
382 | + */ |
|
363 | 383 | private function assertMatchesValidationMessage($errors, $expected) |
364 | 384 | { |
365 | 385 | $expectedWithLocations = []; |