Code Duplication    Length = 25-26 lines in 4 locations

src/Iterator/LazyFilterKeyedIterable.php 1 location

@@ 7-32 (lines=26) @@
4
5
use Collections\KeyedIterable;
6
7
class LazyFilterKeyedIterable implements KeyedIterable
8
{
9
    use LazyKeyedIterableTrait;
10
11
    /**
12
     * @var KeyedIterable
13
     */
14
    private $Enumerable;
15
16
    /**
17
     * @var callable
18
     */
19
    private $fn;
20
21
    public function __construct($Enumerable, $fn)
22
    {
23
        $this->Enumerable = $Enumerable;
24
        $this->fn = $fn;
25
    }
26
27
    public function getIterator()
28
    {
29
        return
30
            new LazyFilterKeyedIterator($this->Enumerable->getIterator(), $this->fn);
31
    }
32
}
33

src/Iterator/LazyFilterWithKeyIterable.php 1 location

@@ 7-32 (lines=26) @@
4
5
use Collections\KeyedIterable;
6
7
class LazyFilterWithKeyIterable implements KeyedIterable
8
{
9
    use LazyKeyedIterableTrait;
10
11
    /**
12
     * @var KeyedIterable
13
     */
14
    private $Enumerable;
15
16
    /**
17
     * @var callable
18
     */
19
    private $fn;
20
21
    public function __construct($Enumerable, $fn)
22
    {
23
        $this->Enumerable = $Enumerable;
24
        $this->fn = $fn;
25
    }
26
27
    public function getIterator()
28
    {
29
        return
30
            new LazyFilterWithKeyIterator($this->Enumerable->getIterator(), $this->fn);
31
    }
32
}
33

src/Iterator/LazyMapKeyedIterable.php 1 location

@@ 7-31 (lines=25) @@
4
5
use Collections\KeyedIterable;
6
7
class LazyMapKeyedIterable implements KeyedIterable
8
{
9
    use LazyKeyedIterableTrait;
10
11
    /**
12
     * @var KeyedIterable
13
     */
14
    private $Enumerable;
15
16
    /**
17
     * @var callable
18
     */
19
    private $fn;
20
21
    public function __construct($Enumerable, $fn)
22
    {
23
        $this->Enumerable = $Enumerable;
24
        $this->fn = $fn;
25
    }
26
27
    public function getIterator()
28
    {
29
        return new LazyMapKeyedIterator($this->Enumerable->getIterator(), $this->fn);
30
    }
31
}
32
33

src/Iterator/LazyMapWithKeyIterable.php 1 location

@@ 7-31 (lines=25) @@
4
5
use Collections\KeyedIterable;
6
7
class LazyMapWithKeyIterable implements KeyedIterable
8
{
9
    use LazyKeyedIterableTrait;
10
11
    /**
12
     * @var KeyedIterable
13
     */
14
    private $Enumerable;
15
16
    /**
17
     * @var callable
18
     */
19
    private $fn;
20
21
    public function __construct($Enumerable, $fn)
22
    {
23
        $this->Enumerable = $Enumerable;
24
        $this->fn = $fn;
25
    }
26
27
    public function getIterator()
28
    {
29
        return new LazyMapWithKeyIterator($this->Enumerable->getIterator(), $this->fn);
30
    }
31
}
32
33