Skip to content

Commit 5e6fcc6

Browse files
committed
there is no need for an iterator in the current implementation
1 parent 69f9673 commit 5e6fcc6

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

README.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ namespace App\Pet\Dto\Model;
184184

185185
use Chubbyphp\Api\Dto\Model\ModelResponseInterface;
186186

187-
final readonly class PetResponse implements \IteratorAggregate, ModelResponseInterface
187+
final readonly class PetResponse implements ModelResponseInterface
188188
{
189189
public function __construct(
190190
public string $id,
@@ -208,11 +208,6 @@ final readonly class PetResponse implements \IteratorAggregate, ModelResponseInt
208208
'_links' => $this->_links,
209209
];
210210
}
211-
212-
public function getIterator(): \Traversable
213-
{
214-
return new \ArrayIterator(get_object_vars($this));
215-
}
216211
}
217212
```
218213

@@ -307,7 +302,7 @@ namespace App\Pet\Dto\Collection;
307302
use App\Pet\Dto\Model\PetResponse;
308303
use Chubbyphp\Api\Dto\Collection\AbstractReadonlyCollectionResponse;
309304

310-
final readonly class PetCollectionResponse extends AbstractCollectionResponse implements \IteratorAggregate
305+
final readonly class PetCollectionResponse extends AbstractCollectionResponse
311306
{
312307
public function __construct(
313308
int $offset,
@@ -330,11 +325,6 @@ final readonly class PetCollectionResponse extends AbstractCollectionResponse im
330325
$_links,
331326
);
332327
}
333-
334-
final public function getIterator(): \Traversable
335-
{
336-
return new \ArrayIterator(get_object_vars($this));
337-
}
338328
}
339329
```
340330

0 commit comments

Comments
 (0)