Issues (13)

src/Api/VM/Traits/IterableObject.php (1 issue)

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
}