comparison program/lib/Roundcube/rcube_result_set.php @ 25:bea5a38be938

More cleaning up php8 Warnings/deprecations
author Charlie Root
date Sat, 18 Oct 2025 12:24:31 -0400
parents 303b85d5b561
children
comparison
equal deleted inserted replaced
24:e53add5ddac5 25:bea5a38be938
45 $this->records[] = $rec; 45 $this->records[] = $rec;
46 } 46 }
47 47
48 function iterate() 48 function iterate()
49 { 49 {
50 return $this->records[$this->current++]; 50 $current = $this->current();
51
52 $this->current++;
53
54 return $current;
51 } 55 }
52 56
53 function first() 57 function first()
54 { 58 {
55 $this->current = 0; 59 $this->current = 0;
82 public function offsetUnset(mixed $offset): void 86 public function offsetUnset(mixed $offset): void
83 { 87 {
84 unset($this->records[$offset]); 88 unset($this->records[$offset]);
85 } 89 }
86 90
87 public function offsetGet($offset) 91 public function offsetGet(mixed $offset): mixed
88 { 92 {
89 return $this->records[$offset]; 93 return $this->records[$offset];
90 } 94 }
91 95
92 /*** PHP 5 Iterator interface ***/ 96 /*** PHP 5 Iterator interface ***/
96 $this->current = 0; 100 $this->current = 0;
97 } 101 }
98 102
99 function current(): mixed 103 function current(): mixed
100 { 104 {
101 return $this->records[$this->current]; 105 return ($this->records[$this->current]??null);
102 } 106 }
103 107
104 function key(): mixed 108 function key(): mixed
105 { 109 {
106 return $this->current; 110 return $this->current;