PairIterator::valid()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace itertools;
4
5
6
class PairIterator extends LookAheadIterator
7
{
8
	public function current()
9
	{
10
		return array(parent::current(), parent::getNext());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (getNext() instead of current()). Are you sure this is correct? If so, you might want to change this to $this->getNext().

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...
11
	}
12
13
	public function valid()
14
	{
15
		return parent::hasNext();
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (hasNext() instead of valid()). Are you sure this is correct? If so, you might want to change this to $this->hasNext().

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...
16
	}
17
}
18
 
19