@@ -6,12 +6,12 @@ trait IterableImplementation
66{
77 protected $ position = 0 ;
88
9- public function offsetGet ($ offset )
9+ public function offsetGet (mixed $ offset ): mixed
1010 {
1111 return $ this ->periods [$ offset ] ?? null ;
1212 }
1313
14- public function offsetSet ($ offset , $ value )
14+ public function offsetSet (mixed $ offset , mixed $ value ): void
1515 {
1616 if (is_null ($ offset )) {
1717 $ this ->periods [] = $ value ;
@@ -22,32 +22,32 @@ public function offsetSet($offset, $value)
2222 $ this ->periods [$ offset ] = $ value ;
2323 }
2424
25- public function offsetExists ($ offset )
25+ public function offsetExists (mixed $ offset ): bool
2626 {
2727 return array_key_exists ($ offset , $ this ->periods );
2828 }
2929
30- public function offsetUnset ($ offset )
30+ public function offsetUnset (mixed $ offset ): void
3131 {
3232 unset($ this ->periods [$ offset ]);
3333 }
3434
35- public function next ()
35+ public function next (): void
3636 {
3737 $ this ->position ++;
3838 }
3939
40- public function key ()
40+ public function key (): mixed
4141 {
4242 return $ this ->position ;
4343 }
4444
45- public function valid ()
45+ public function valid (): bool
4646 {
4747 return array_key_exists ($ this ->position , $ this ->periods );
4848 }
4949
50- public function rewind ()
50+ public function rewind (): void
5151 {
5252 $ this ->position = 0 ;
5353 }
0 commit comments