@@ -39,12 +39,9 @@ public static function createParserProvider(): array
3939 }
4040
4141 /**
42- * @test
4342 * @dataProvider createParserProvider
44- *
45- * @param mixed $parser
4643 */
47- public function testParseSimpleResourceWithDifferentParser ($ parser ): void
44+ public function testParseSimpleResourceWithDifferentParser (callable $ parser ): void
4845 {
4946 $ string = $ this ->getJsonString ('01_simple_resource.json ' );
5047 $ document = $ parser ($ string );
@@ -178,6 +175,7 @@ public function testParseCompleteResourceObjectWithMultipleRelationships(): void
178175 $ this ->assertTrue ($ document ->has ('included ' ));
179176 $ this ->assertTrue ($ document ->has ('data ' ));
180177
178+ /** @var Accessable */
181179 $ resources = $ document ->get ('data ' );
182180
183181 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\ResourceCollection ' , $ resources );
@@ -186,6 +184,8 @@ public function testParseCompleteResourceObjectWithMultipleRelationships(): void
186184 $ this ->assertSame ($ resources ->getKeys (), [0 ]);
187185
188186 $ this ->assertTrue ($ resources ->has (0 ));
187+
188+ /** @var Accessable */
189189 $ resource = $ resources ->get (0 );
190190
191191 $ this ->assertFalse ($ resource ->has ('meta ' ));
@@ -195,24 +195,28 @@ public function testParseCompleteResourceObjectWithMultipleRelationships(): void
195195 $ this ->assertTrue ($ resource ->has ('relationships ' ));
196196 $ this ->assertTrue ($ resource ->has ('links ' ));
197197
198+ /** @var Accessable */
198199 $ attributes = $ resource ->get ('attributes ' );
199200
200201 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\Attributes ' , $ attributes );
201202 $ this ->assertTrue ($ attributes ->has ('title ' ));
202203 $ this ->assertSame ($ attributes ->get ('title ' ), 'JSON API paints my bikeshed! ' );
203204
205+ /** @var Accessable */
204206 $ collection = $ resource ->get ('relationships ' );
205207
206208 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\RelationshipCollection ' , $ collection );
207209 $ this ->assertTrue ($ collection ->has ('author ' ));
208210 $ this ->assertTrue ($ collection ->has ('comments ' ));
209211
212+ /** @var Accessable */
210213 $ author = $ collection ->get ('author ' );
211214
212215 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\Relationship ' , $ author );
213216 $ this ->assertTrue ($ author ->has ('links ' ));
214217 $ this ->assertTrue ($ author ->has ('data ' ));
215218
219+ /** @var Accessable */
216220 $ links = $ author ->get ('links ' );
217221
218222 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\RelationshipLink ' , $ links );
@@ -221,18 +225,21 @@ public function testParseCompleteResourceObjectWithMultipleRelationships(): void
221225 $ this ->assertTrue ($ links ->has ('related ' ));
222226 $ this ->assertSame ($ links ->get ('related ' ), 'http://example.com/articles/1/author ' );
223227
228+ /** @var Accessable */
224229 $ data = $ author ->get ('data ' );
225230
226231 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\ResourceIdentifier ' , $ data );
227232 $ this ->assertSame ($ data ->get ('type ' ), 'people ' );
228233 $ this ->assertSame ($ data ->get ('id ' ), '9 ' );
229234
235+ /** @var Accessable */
230236 $ comments = $ collection ->get ('comments ' );
231237
232238 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\Relationship ' , $ comments );
233239 $ this ->assertTrue ($ comments ->has ('links ' ));
234240 $ this ->assertTrue ($ comments ->has ('data ' ));
235241
242+ /** @var Accessable */
236243 $ links = $ comments ->get ('links ' );
237244
238245 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\RelationshipLink ' , $ links );
@@ -241,35 +248,42 @@ public function testParseCompleteResourceObjectWithMultipleRelationships(): void
241248 $ this ->assertTrue ($ links ->has ('related ' ));
242249 $ this ->assertSame ($ links ->get ('related ' ), 'http://example.com/articles/1/comments ' );
243250
251+ /** @var Accessable */
244252 $ data_array = $ comments ->get ('data ' );
245253
246254 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\ResourceIdentifierCollection ' , $ data_array );
247255 $ this ->assertCount (2 , $ data_array ->getKeys ());
248256
257+ /** @var Accessable */
249258 $ identifier = $ data_array ->get (0 );
250259
251260 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\ResourceIdentifier ' , $ identifier );
252261 $ this ->assertSame ($ identifier ->get ('type ' ), 'comments ' );
253262 $ this ->assertSame ($ identifier ->get ('id ' ), '5 ' );
254263
264+ /** @var Accessable */
255265 $ identifier = $ data_array ->get (1 );
256266
257267 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\ResourceIdentifier ' , $ identifier );
258268 $ this ->assertSame ($ identifier ->get ('type ' ), 'comments ' );
259269 $ this ->assertSame ($ identifier ->get ('id ' ), '12 ' );
260270
271+ /** @var Accessable */
261272 $ links = $ resource ->get ('links ' );
262273
263274 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\ResourceItemLink ' , $ links );
264275 $ this ->assertTrue ($ links ->has ('self ' ));
265276 $ this ->assertSame ($ links ->get ('self ' ), 'http://example.com/articles/1 ' );
266277
278+ /** @var Accessable */
267279 $ includes = $ document ->get ('included ' );
268280
269281 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\ResourceCollection ' , $ includes );
270282 $ this ->assertSame ($ includes ->getKeys (), [0 , 1 , 2 ]);
271283
272284 $ this ->assertTrue ($ includes ->has (0 ));
285+
286+ /** @var Accessable */
273287 $ include = $ includes ->get (0 );
274288
275289 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\ResourceItem ' , $ include );
@@ -278,6 +292,7 @@ public function testParseCompleteResourceObjectWithMultipleRelationships(): void
278292 $ this ->assertTrue ($ include ->has ('attributes ' ));
279293 $ this ->assertTrue ($ include ->has ('links ' ));
280294
295+ /** @var Accessable */
281296 $ attributes = $ include ->get ('attributes ' );
282297
283298 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\Attributes ' , $ attributes );
@@ -288,13 +303,16 @@ public function testParseCompleteResourceObjectWithMultipleRelationships(): void
288303 $ this ->assertTrue ($ attributes ->has ('twitter ' ));
289304 $ this ->assertSame ($ attributes ->get ('twitter ' ), 'dgeb ' );
290305
306+ /** @var Accessable */
291307 $ links = $ include ->get ('links ' );
292308
293309 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\ResourceItemLink ' , $ links );
294310 $ this ->assertTrue ($ links ->has ('self ' ));
295311 $ this ->assertSame ($ links ->get ('self ' ), 'http://example.com/people/9 ' );
296312
297313 $ this ->assertTrue ($ includes ->has (1 ));
314+
315+ /** @var Accessable */
298316 $ include = $ includes ->get (1 );
299317
300318 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\ResourceItem ' , $ include );
0 commit comments