File tree Expand file tree Collapse file tree 4 files changed +2
-39
lines changed
Expand file tree Collapse file tree 4 files changed +2
-39
lines changed Original file line number Diff line number Diff line change 1212 * @property PetCollectionSort $sort
1313 * @property array<PetResponse> $items
1414 *
15- * @implements \IteratorAggregate<string, mixed>
16- *
1715 * @phpstan-type JsonSerializedResult array{
1816 * offset: int,
1917 * limit: int,
5048 *
5149 * @method JsonSerializedResult jsonSerialize()
5250 */
53- final readonly class PetCollectionResponse extends AbstractReadonlyCollectionResponse implements \IteratorAggregate
51+ final readonly class PetCollectionResponse extends AbstractReadonlyCollectionResponse
5452{
5553 public function __construct (
5654 int $ offset ,
@@ -73,9 +71,4 @@ public function __construct(
7371 $ _links ,
7472 );
7573 }
76-
77- public function getIterator (): \Traversable
78- {
79- return new \ArrayIterator (get_object_vars ($ this ));
80- }
8174}
Original file line number Diff line number Diff line change 66
77use Chubbyphp \Api \Dto \Model \ModelResponseInterface ;
88
9- /**
10- * @implements \IteratorAggregate<string, mixed>
11- */
12- final readonly class PetResponse implements \IteratorAggregate, ModelResponseInterface
9+ final readonly class PetResponse implements ModelResponseInterface
1310{
1411 /**
1512 * @param array<VaccinationResponse> $vaccinations
@@ -65,9 +62,4 @@ public function jsonSerialize(): array
6562 '_links ' => $ this ->_links ,
6663 ];
6764 }
68-
69- public function getIterator (): \Traversable
70- {
71- return new \ArrayIterator (get_object_vars ($ this ));
72- }
7365}
Original file line number Diff line number Diff line change @@ -80,16 +80,5 @@ public function testCreateCollection(): void
8080 '_type ' => 'petCollection ' ,
8181 '_links ' => [],
8282 ], $ petCollectionResponse ->jsonSerialize ());
83-
84- self ::assertSame ([
85- 'offset ' => 5 ,
86- 'limit ' => 10 ,
87- 'filters ' => $ petCollectionFilters ,
88- 'sort ' => $ petCollectionSort ,
89- 'items ' => [$ petResponse ],
90- 'count ' => 1 ,
91- '_type ' => 'petCollection ' ,
92- '_links ' => [],
93- ], [...$ petCollectionResponse ]);
9483 }
9584}
Original file line number Diff line number Diff line change @@ -46,16 +46,5 @@ public function testCreateCollection(): void
4646 '_type ' => 'pet ' ,
4747 '_links ' => [],
4848 ], $ petResponse ->jsonSerialize ());
49-
50- self ::assertSame ([
51- 'id ' => '019c201f-6a83-7696-9899-50fbf7b2278d ' ,
52- 'createdAt ' => '2024-02-10T18:15:00+00:00 ' ,
53- 'updatedAt ' => '2024-02-10T18:15:00+00:00 ' ,
54- 'name ' => 'jerry ' ,
55- 'tag ' => 'tag ' ,
56- 'vaccinations ' => [$ vaccinationResponse ],
57- '_type ' => 'pet ' ,
58- '_links ' => [],
59- ], [...$ petResponse ]);
6049 }
6150}
You can’t perform that action at this time.
0 commit comments