LazySkipIterable::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 5
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace Collections\Iterator;
4
5
6
use Collections\Enumerable;
7
8 View Code Duplication
class LazySkipIterable implements Enumerable
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    use LazyIterableTrait;
11
12
    /**
13
     * @var Enumerable
14
     */
15
    private $Enumerable;
16
17
    /**
18
     * @var int
19
     */
20
    private $n;
21
22
    public function __construct($Enumerable, $n)
23
    {
24
        $this->Enumerable = $Enumerable;
25
        $this->n = $n;
26
    }
27
28
    public function getIterator()
29
    {
30
        return new LazySkipIterator($this->Enumerable->getIterator(), $this->n);
31
    }
32
}
33
34