OuterIteratorTrait::rewind()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Shrikeh\Collection;
4
5
/**
6
 * Trait OuterIteratorTrait
7
 * @package Shrikeh\Collection
8
 */
9
trait OuterIteratorTrait
10
{
11
    /**
12
     * @return mixed
13
     */
14
    public function current()
15
    {
16
        return $this->getStorage()->current();
17
    }
18
19
    /**
20
     * @return mixed
21
     */
22
    public function key()
23
    {
24
        return $this->getStorage()->key();
25
    }
26
27
    /**
28
     * @return mixed
29
     */
30
    public function next()
31
    {
32
        return $this->getStorage()->next();
33
    }
34
35
    /**
36
     * @return mixed
37
     */
38
    public function valid()
39
    {
40
        return $this->getStorage()->valid();
41
    }
42
43
    /**
44
     * @return mixed
45
     */
46
    public function rewind()
47
    {
48
        return $this->getStorage()->rewind();
49
    }
50
51
    /**
52
     * @return mixed
53
     */
54
    protected function getStorage()
55
    {
56
        return parent::getInnerIterator();
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (getInnerIterator() instead of getStorage()). Are you sure this is correct? If so, you might want to change this to $this->getInnerIterator().

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...
57
    }
58
}
59