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.

StepIterator   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A next() 0 7 3
1
<?php
2
3
namespace Gielfeldt\Iterators;
4
5
class StepIterator extends TraversableIterator
6
{
7
    private $step;
8
9
    public function __construct(\Traversable $iterator, int $step)
10 1
    {
11
        $this->step = $step;
12 1
        parent::__construct($iterator);
13 1
    }
14 1
15 1
    public function next()
16
    {
17 1
        $step = $this->step;
18
        while ($step-- > 0 && parent::valid()) {
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (valid() instead of next()). Are you sure this is correct? If so, you might want to change this to $this->valid().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
19 1
            parent::next();
20 1
        }
21 1
    }
22
}
23