Skip to content

Commit c50059e

Browse files
committed
resolve conflict of the Interator
1 parent 8d17a06 commit c50059e

File tree

4 files changed

+6
-33
lines changed

4 files changed

+6
-33
lines changed

src/DataStructure/Behavioral/IterableCollection.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
namespace KaririCode\Contract\DataStructure\Behavioral;
66

7+
use KaririCode\Contract\DataStructure\Behavioral\Iterator;
8+
79
/**
810
* Interface IterableCollection.
911
*
1012
* Provides the ability to iterate over a collection.
1113
*
1214
* @author Walmir Silva <walmir.silva@kariricode.org>
13-
* @author Walmir Silva <walmir.silva@kariricode.org>
1415
* @license MIT
1516
*
1617
* @see https://kariricode.org/
@@ -20,7 +21,7 @@ interface IterableCollection extends \Traversable
2021
/**
2122
* Gets an iterator for the collection.
2223
*
23-
* @return Iterator an iterator for the collection
24+
* @return \Traversable an iterator for the collection
2425
*/
25-
public function getIterator(): Iterator;
26+
public function getIterator(): \Traversable;
2627
}

src/DataStructure/Structural/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* @see https://kariricode.org/
2222
*/
23-
interface Collection extends Countable, Indexable, IterableCollection
23+
interface Collection extends Countable, Indexable
2424
{
2525
/**
2626
* Adds an element to the collection.

tests/DataStructure/Behavioral/IteratorTest.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

tests/DataStructure/IterableCollectionTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
namespace KaririCode\Contract\Tests\DataStructure;
66

77
use KaririCode\Contract\DataStructure\Behavioral\IterableCollection;
8-
use KaririCode\Contract\DataStructure\Behavioral\Iterator;
98
use PHPUnit\Framework\TestCase;
109

1110
final class IterableCollectionTest extends TestCase
1211
{
1312
public function testGetIterator(): void
1413
{
15-
$iteratorMock = $this->createMock(Iterator::class);
14+
$iteratorMock = $this->createMock(\Iterator::class);
1615
$mock = $this->createMock(IterableCollection::class);
1716
$mock->method('getIterator')->willReturn($iteratorMock);
1817

0 commit comments

Comments
 (0)