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   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 31
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __constructIterator() 0 5 2
getSourceIterator() 0 1 ?
A isArrayCompatible() 0 4 1
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