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 — develop ( 5dd8b5...0ed171 )
by Baptiste
02:38
created

NumericRange   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 10
lcom 1
cbo 0
dl 0
loc 64
ccs 29
cts 29
cp 1
rs 10
c 0
b 0
f 0

10 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A start() 0 4 1
A end() 0 4 1
A step() 0 4 1
A toPrimitive() 0 4 1
A current() 0 4 1
A key() 0 4 1
A next() 0 5 1
A rewind() 0 5 1
A valid() 0 4 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Immutable;
5
6
class NumericRange implements PrimitiveInterface, \Iterator
7
{
8
    private $start;
9
    private $end;
10
    private $step;
11
    private $key;
12
    private $current;
13
14 1
    public function __construct(float $start, float $end, float $step = 1)
15
    {
16 1
        $this->start = $start;
17 1
        $this->end = $end;
18 1
        $this->step = $step;
19 1
        $this->key = 0;
20 1
        $this->current = $start;
21 1
    }
22
23 1
    public function start(): float
24
    {
25 1
        return $this->start;
26
    }
27
28 1
    public function end(): float
29
    {
30 1
        return $this->end;
31
    }
32
33 1
    public function step(): float
34
    {
35 1
        return $this->step;
36
    }
37
38 1
    public function toPrimitive()
39
    {
40 1
        return range($this->start, $this->end, $this->step);
41
    }
42
43 1
    public function current()
44
    {
45 1
        return $this->current;
46
    }
47
48 1
    public function key()
49
    {
50 1
        return $this->key;
51
    }
52
53 1
    public function next()
54
    {
55 1
        ++$this->key;
56 1
        $this->current += $this->step;
57 1
    }
58
59 1
    public function rewind()
60
    {
61 1
        $this->key = 0;
62 1
        $this->current = $this->start;
63 1
    }
64
65 1
    public function valid()
66
    {
67 1
        return $this->current < $this->end;
68
    }
69
}
70