PairIterator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 12
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A current() 0 4 1
A valid() 0 4 1
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