@@ -42,6 +42,7 @@ public function __construct($escapingMethod, $value)
42
42
/**
43
43
* Reset the array to the beginning (as required for the Iterator interface).
44
44
*/
45
+ #[ReturnTypeWillChange]
45
46
public function rewind ()
46
47
{
47
48
reset ($ this ->value );
@@ -54,6 +55,7 @@ public function rewind()
54
55
*
55
56
* @return string The key
56
57
*/
58
+ #[ReturnTypeWillChange]
57
59
public function key ()
58
60
{
59
61
return key ($ this ->value );
@@ -67,6 +69,7 @@ public function key()
67
69
*
68
70
* @return mixed The escaped value
69
71
*/
72
+ #[ReturnTypeWillChange]
70
73
public function current ()
71
74
{
72
75
return sfOutputEscaper::escape ($ this ->escapingMethod , current ($ this ->value ));
@@ -75,6 +78,7 @@ public function current()
75
78
/**
76
79
* Moves to the next element (as required by the Iterator interface).
77
80
*/
81
+ #[ReturnTypeWillChange]
78
82
public function next ()
79
83
{
80
84
next ($ this ->value );
@@ -91,6 +95,7 @@ public function next()
91
95
*
92
96
* @return bool The validity of the current element; true if it is valid
93
97
*/
98
+ #[ReturnTypeWillChange]
94
99
public function valid ()
95
100
{
96
101
return $ this ->count > 0 ;
@@ -103,6 +108,7 @@ public function valid()
103
108
*
104
109
* @return bool true if the offset isset; false otherwise
105
110
*/
111
+ #[ReturnTypeWillChange]
106
112
public function offsetExists ($ offset )
107
113
{
108
114
return isset ($ this ->value [$ offset ]);
@@ -115,9 +121,10 @@ public function offsetExists($offset)
115
121
*
116
122
* @return mixed The escaped value
117
123
*/
124
+ #[ReturnTypeWillChange]
118
125
public function offsetGet ($ offset )
119
126
{
120
- return sfOutputEscaper::escape ($ this ->escapingMethod , $ this ->value [$ offset ]);
127
+ return sfOutputEscaper::escape ($ this ->escapingMethod , isset ( $ this ->value [$ offset ]) ? $ this -> value [ $ offset ] : null );
121
128
}
122
129
123
130
/**
@@ -132,6 +139,7 @@ public function offsetGet($offset)
132
139
*
133
140
* @throws sfException
134
141
*/
142
+ #[ReturnTypeWillChange]
135
143
public function offsetSet ($ offset , $ value )
136
144
{
137
145
throw new sfException ('Cannot set values. ' );
@@ -148,6 +156,7 @@ public function offsetSet($offset, $value)
148
156
*
149
157
* @throws sfException
150
158
*/
159
+ #[ReturnTypeWillChange]
151
160
public function offsetUnset ($ offset )
152
161
{
153
162
throw new sfException ('Cannot unset values. ' );
@@ -158,6 +167,7 @@ public function offsetUnset($offset)
158
167
*
159
168
* @return int The size of the array
160
169
*/
170
+ #[ReturnTypeWillChange]
161
171
public function count ()
162
172
{
163
173
return count ($ this ->value );
0 commit comments