Skip to content

Commit

Permalink
refactor: Use StringIteratorAggregate. (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol authored Jan 23, 2022
1 parent e19bde8 commit 2f15b72
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 150 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
],
"require": {
"php": ">= 7.4",
"loophp/iterators": "^1.5"
"loophp/iterators": "^1.5.6"
},
"require-dev": {
"amphp/parallel-functions": "^1",
Expand Down
4 changes: 2 additions & 2 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use loophp\collection\Contract\Collection as CollectionInterface;
use loophp\collection\Contract\Operation;
use loophp\collection\Iterator\ResourceIterator;
use loophp\collection\Iterator\StringIterator;
use loophp\collection\Operation\All;
use loophp\collection\Operation\Append;
use loophp\collection\Operation\Apply;
Expand Down Expand Up @@ -136,6 +135,7 @@
use loophp\iterators\CachingIteratorAggregate;
use loophp\iterators\ClosureIterator;
use loophp\iterators\IterableIterator;
use loophp\iterators\StringIteratorAggregate;
use NoRewindIterator;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
Expand Down Expand Up @@ -525,7 +525,7 @@ public static function fromResource($resource): self
*/
public static function fromString(string $string, string $delimiter = ''): self
{
return new self(static fn (): Iterator => new StringIterator($string, $delimiter));
return new self(static fn (): IteratorAggregate => new StringIteratorAggregate($string, $delimiter));
}

public function get($key, $default = null): CollectionInterface
Expand Down
84 changes: 0 additions & 84 deletions src/Iterator/StringIterator.php

This file was deleted.

63 changes: 0 additions & 63 deletions tests/unit/Iterator/StringIteratorTest.php

This file was deleted.

0 comments on commit 2f15b72

Please sign in to comment.