Code Duplication    Length = 25-26 lines in 6 locations

src/Iterator/LazyFilterIterable.php 1 location

@@ 7-31 (lines=25) @@
4
5
use Collections\Enumerable;
6
7
class LazyFilterIterable implements Enumerable
8
{
9
    use LazyIterableTrait;
10
11
    /**
12
     * @var Enumerable
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 LazyFilterIterator($this->Enumerable->getIterator(), $this->fn);
30
    }
31
}
32

src/Iterator/LazyMapIterable.php 1 location

@@ 7-31 (lines=25) @@
4
5
use Collections\Enumerable;
6
7
class LazyMapIterable implements Enumerable
8
{
9
    use LazyIterableTrait;
10
11
    /**
12
     * @var Enumerable
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 LazyMapIterator($this->Enumerable->getIterator(), $this->fn);
30
    }
31
}
32

src/Iterator/LazySkipWhileIterable.php 1 location

@@ 7-32 (lines=26) @@
4
5
use Collections\Enumerable;
6
7
class LazySkipWhileIterable implements Enumerable
8
{
9
    use LazyIterableTrait;
10
11
    /**
12
     * @var Enumerable
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 LazySkipWhileIterator($this->Enumerable->getIterator(),
30
            $this->fn);
31
    }
32
}
33

src/Iterator/LazySkipWhileKeyedIterable.php 1 location

@@ 7-31 (lines=25) @@
4
5
use Collections\Enumerable;
6
7
class LazySkipWhileKeyedIterable implements Enumerable
8
{
9
    use LazyIterableTrait;
10
11
    /**
12
     * @var Enumerable
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 LazySkipWhileKeyedIterator($this->Enumerable->getIterator(), $this->fn);
30
    }
31
}
32

src/Iterator/LazyTakeWhileIterable.php 1 location

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

src/Iterator/LazyTakeWhileKeyedIterable.php 1 location

@@ 7-31 (lines=25) @@
4
5
use Collections\Enumerable;
6
7
class LazyTakeWhileKeyedIterable implements Enumerable
8
{
9
    use LazyIterableTrait;
10
11
    /**
12
     * @var Enumerable
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 LazyTakeWhileKeyedIterator($this->Enumerable->getIterator(), $this->fn);
30
    }
31
}
32