Skip to content

Commit 3c502da

Browse files
committed
refactor: Rename ArrayInterface to CollectionInterface.
1 parent b02555a commit 3c502da

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* fix(`composer.json`): Change PHP require to `>=8.2`.
66
* refactor(`Mapper`): Move under implementation namespace.
7+
* refactor: Rename `ArrayInterface` to `CollectionInterface`.
78

89
## 0.9.1
910

src/ArrayInterface.php src/CollectionInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
* @extends \IteratorAggregate<TKey,TValue>
2020
* @extends \ArrayAccess<TKey,TValue>
2121
*/
22-
interface ArrayInterface extends \ArrayAccess, \IteratorAggregate, \Countable
22+
interface CollectionInterface extends \ArrayAccess, \IteratorAggregate, \Countable
2323
{
2424
}

src/Transformer/ArrayLikeMetadata/Implementation/ArrayLikeMetadataFactory.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace Rekalogika\Mapper\Transformer\ArrayLikeMetadata\Implementation;
1515

16-
use Rekalogika\Mapper\ArrayInterface;
16+
use Rekalogika\Mapper\CollectionInterface;
1717
use Rekalogika\Mapper\Exception\InvalidArgumentException;
1818
use Rekalogika\Mapper\Transformer\ArrayLikeMetadata\ArrayLikeMetadata;
1919
use Rekalogika\Mapper\Transformer\ArrayLikeMetadata\ArrayLikeMetadataFactoryInterface;
@@ -96,7 +96,7 @@ public function createArrayLikeMetadata(
9696
&& (
9797
$targetClass === \ArrayAccess::class
9898
|| $targetClass === \Traversable::class
99-
|| $targetClass === ArrayInterface::class
99+
|| $targetClass === CollectionInterface::class
100100
);
101101

102102
return new ArrayLikeMetadata(

src/Transformer/Model/LazyArray.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace Rekalogika\Mapper\Transformer\Model;
1515

16-
use Rekalogika\Mapper\ArrayInterface;
16+
use Rekalogika\Mapper\CollectionInterface;
1717
use Rekalogika\Mapper\Context\Context;
1818
use Rekalogika\Mapper\Exception\LogicException;
1919
use Rekalogika\Mapper\MainTransformer\MainTransformerInterface;
@@ -24,10 +24,10 @@
2424
/**
2525
* @template TKey of array-key
2626
* @template TValue
27-
* @implements ArrayInterface<TKey,TValue>
27+
* @implements CollectionInterface<TKey,TValue>
2828
* @internal
2929
*/
30-
final class LazyArray implements ArrayInterface
30+
final class LazyArray implements CollectionInterface
3131
{
3232
use MainTransformerAwareTrait;
3333
use ArrayLikeTransformerTrait;

src/Transformer/TraversableToArrayAccessTransformer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Doctrine\Common\Collections\ArrayCollection;
1717
use Doctrine\Common\Collections\Collection;
1818
use Doctrine\Common\Collections\ReadableCollection;
19-
use Rekalogika\Mapper\ArrayInterface;
19+
use Rekalogika\Mapper\CollectionInterface;
2020
use Rekalogika\Mapper\Context\Context;
2121
use Rekalogika\Mapper\Exception\InvalidArgumentException;
2222
use Rekalogika\Mapper\ObjectCache\ObjectCache;
@@ -230,7 +230,7 @@ public function getSupportedTransformation(): iterable
230230
TypeFactory::objectOfClass(\ArrayObject::class),
231231
TypeFactory::objectOfClass(\ArrayIterator::class),
232232
TypeFactory::objectOfClass(\ArrayAccess::class),
233-
TypeFactory::objectOfClass(ArrayInterface::class),
233+
TypeFactory::objectOfClass(CollectionInterface::class),
234234
TypeFactory::array(),
235235
];
236236

tests/Fixtures/ArrayLikeDto/ObjectWithArrayInterfacePropertyDto.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313

1414
namespace Rekalogika\Mapper\Tests\Fixtures\ArrayLikeDto;
1515

16-
use Rekalogika\Mapper\ArrayInterface;
16+
use Rekalogika\Mapper\CollectionInterface;
1717
use Rekalogika\Mapper\Tests\Fixtures\ScalarDto\ObjectWithScalarPropertiesDto;
1818

1919
class ObjectWithArrayInterfacePropertyDto
2020
{
2121
/**
22-
* @var ?ArrayInterface<int,ObjectWithScalarPropertiesDto>
22+
* @var ?CollectionInterface<int,ObjectWithScalarPropertiesDto>
2323
*/
24-
public ?ArrayInterface $property = null;
24+
public ?CollectionInterface $property = null;
2525
}

0 commit comments

Comments
 (0)