Skip to content

Commit

Permalink
feat(TraversableToArrayAccessTransformer): Now supports `ArrayColle…
Browse files Browse the repository at this point in the history
…ction` & `ArrayIterator`.
  • Loading branch information
priyadi committed Jan 15, 2024
1 parent ea7bfae commit 45f7431
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* fix(`MainTransformer`): Fix possible bug involving an existing target.
* fix(`MainTransformer`): Make sure the target has the same type as the target
type.
* feat(`TraversableToArrayAccessTransformer`): Now supports `ArrayCollection` & `ArrayIterator`.

## 0.5.10

Expand Down
2 changes: 2 additions & 0 deletions src/Transformer/TraversableToArrayAccessTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ public function getSupportedTransformation(): iterable

$targetTypes = [
TypeFactory::objectOfClass(Collection::class),
TypeFactory::objectOfClass(ArrayCollection::class),
TypeFactory::objectOfClass(\ArrayObject::class),
TypeFactory::objectOfClass(\ArrayIterator::class),
TypeFactory::objectOfClass(\ArrayAccess::class),
TypeFactory::array(),
];
Expand Down

0 comments on commit 45f7431

Please sign in to comment.