IterableObject::rewind()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
4
namespace FNDEV\vShpare\Api\VM\Traits;
5
6
7
trait IterableObject
8
{
9
    public function current()
10
    {
11
        return $this->items[$this->position];
12
    }
13
    public function next()
14
    {
15
        ++$this->position;
16
    }
17
    public function key()
18
    {
19
        return $this->position;
20
    }
21
    public function valid()
22
    {
23
        return array_key_exists($this->position,$this->items);
24
    }
25
    public function rewind()
26
    {
27
        $this->position = 0;
0 ignored issues
show
Bug Best Practice introduced by
The property position does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
28
    }
29
30
}