GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 9000d2...f19783 )
by Time
06:05
created

RangeIterator::__constructIterator()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 5
rs 9.4286
cc 2
eloc 3
nc 2
nop 2
1
<?php
2
3
namespace Pinq\Iterators\Common;
4
5
use Pinq\Iterators\IIterator;
6
7
/**
8
 * Iterates over a specified range of the inner values.
9
 *
10
 * @author Elliot Levin <[email protected]>
11
 */
12
trait RangeIterator
13
{
14
    /**
15
     * @var int
16
     */
17
    protected $startPosition;
18
19
    /**
20
     * @var int|null
21
     */
22
    protected $endPosition;
23
24
    protected function __constructIterator($startAmount, $rangeAmount)
25
    {
26
        $this->startPosition = $startAmount;
27
        $this->endPosition   = $rangeAmount === null ? null : $startAmount + $rangeAmount;
28
    }
29
30
    /**
31
     * @return IIterator
32
     */
33
    abstract protected function getSourceIterator();
34
35
    /**
36
     * @return bool
37
     */
38
    final public function isArrayCompatible()
39
    {
40
        return $this->getSourceIterator()->isArrayCompatible();
41
    }
42
}
43