1 | <?php |
||
28 | trait SeekableInterfaceTrait |
||
29 | { |
||
30 | /** |
||
31 | * Seek to a specific position in the collection. |
||
32 | * |
||
33 | * @see ArrayIterator::seek |
||
34 | * @param integer $position The location in the collection to seek to. |
||
35 | * @return mixed The value of the node at the seek location. |
||
36 | */ |
||
37 | public function seek($position) |
||
44 | |||
45 | /** |
||
46 | * Return the current entry in the collection. |
||
47 | * |
||
48 | * @see ArrayIterator::current() |
||
49 | * @return mixed The current entry in the collection. |
||
50 | */ |
||
51 | public function current() |
||
55 | |||
56 | /** |
||
57 | * Return the current key in the collection. |
||
58 | * |
||
59 | * @see ArrayIterator::key() |
||
60 | * @return mixed The current key in the collection. |
||
61 | */ |
||
62 | public function key() |
||
66 | |||
67 | /** |
||
68 | * Move to the next entry in the collection. |
||
69 | * |
||
70 | * @see ArrayIterator::next() |
||
71 | */ |
||
72 | public function next() |
||
78 | |||
79 | /** |
||
80 | * Rewind pointer back to the beginning of the collection. |
||
81 | * |
||
82 | * @see ArrayIterator::rewind() |
||
83 | */ |
||
84 | public function rewind() |
||
90 | |||
91 | /** |
||
92 | * Check whether or not the collection contains more entries. |
||
93 | * |
||
94 | * @see ArrayIterator::valid() |
||
95 | * @return boolean A value of `true` indicates that the collection contains more entries. A value of `false` |
||
96 | * indicates that there are no remaining entries. |
||
97 | */ |
||
98 | public function valid() |
||
102 | } |
||
103 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: