| Total Complexity | 6 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class LinkedListIterator implements Iterator |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var LinkedList iterator owner |
||
| 14 | */ |
||
| 15 | protected LinkedList $owner; |
||
| 16 | /** |
||
| 17 | * @var LinkedListItem|null current position |
||
| 18 | */ |
||
| 19 | protected ?LinkedListItem $position = null; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * LinkedListIterator constructor. |
||
| 23 | * @param LinkedList $owner iterator owner |
||
| 24 | */ |
||
| 25 | public function __construct(LinkedList $owner) |
||
| 26 | { |
||
| 27 | $this->owner = $owner; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @inheritDoc |
||
| 32 | */ |
||
| 33 | public function current() |
||
| 34 | { |
||
| 35 | return $this->position->getData(); |
||
|
|
|||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @inheritDoc |
||
| 40 | */ |
||
| 41 | public function next(): void |
||
| 42 | { |
||
| 43 | $this->position = $this->position->getNext(); |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @inheritDoc |
||
| 48 | * @return LinkedListItem |
||
| 49 | */ |
||
| 50 | public function key(): LinkedListItem |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @inheritDoc |
||
| 57 | */ |
||
| 58 | public function valid(): bool |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @inheritDoc |
||
| 65 | */ |
||
| 66 | public function rewind(): void |
||
| 69 | } |
||
| 70 | } |
||
| 71 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.