2
2
3
3
namespace Curl ;
4
4
5
- class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator {
5
+ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator
6
+ {
6
7
7
8
/**
8
9
* @var mixed[] Data storage with lower-case keys
@@ -37,12 +38,11 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator {
37
38
* @return void
38
39
*
39
40
* @access public
40
- *
41
- * @author Michael Mulligan <michael@bigroomstudios.com>
42
41
*/
43
- public function __construct (Array $ initial = NULL ) {
44
- if ($ initial !== NULL ) {
45
- foreach ($ initial as $ key => $ value ) {
42
+ public function __construct (Array $ initial = NULL )
43
+ {
44
+ if ($ initial !== NULL ) {
45
+ foreach ($ initial as $ key => $ value ) {
46
46
$ this ->offsetSet ($ key , $ value );
47
47
}
48
48
}
@@ -63,10 +63,9 @@ public function __construct(Array $initial = NULL) {
63
63
* @return void
64
64
*
65
65
* @access public
66
- *
67
- * @author Michael Mulligan <michael@bigroomstudios.com>
68
66
*/
69
- public function offsetSet ($ offset , $ value ) {
67
+ public function offsetSet ($ offset , $ value )
68
+ {
70
69
if ($ offset === null ) {
71
70
$ this ->data [] = $ value ;
72
71
} else {
@@ -89,10 +88,9 @@ public function offsetSet($offset, $value) {
89
88
* @return bool If the offset exists.
90
89
*
91
90
* @access public
92
- *
93
- * @author Michael Mulligan <michael@bigroomstudios.com>
94
91
*/
95
- public function offsetExists ($ offset ) {
92
+ public function offsetExists ($ offset )
93
+ {
96
94
return (bool ) array_key_exists (strtolower ($ offset ), $ this ->data );
97
95
}
98
96
@@ -109,10 +107,9 @@ public function offsetExists($offset) {
109
107
* @return void
110
108
*
111
109
* @access public
112
- *
113
- * @author Michael Mulligan <michael@bigroomstudios.com>
114
110
*/
115
- public function offsetUnset ($ offset ) {
111
+ public function offsetUnset ($ offset )
112
+ {
116
113
$ offsetlower = strtolower ($ offset );
117
114
unset($ this ->data [$ offsetlower ]);
118
115
unset($ this ->keys [$ offsetlower ]);
@@ -131,12 +128,10 @@ public function offsetUnset($offset) {
131
128
* @return mixed The data stored at the offset.
132
129
*
133
130
* @access public
134
- *
135
- * @author Michael Mulligan <michael@bigroomstudios.com>
136
131
*/
137
- public function offsetGet ($ offset ) {
132
+ public function offsetGet ($ offset )
133
+ {
138
134
$ offsetlower = strtolower ($ offset );
139
- // As isset() is false on 'NULL' anyway, use it, and return NULL, faster
140
135
return isset ($ this ->data [$ offsetlower ]) ? $ this ->data [$ offsetlower ] : NULL ;
141
136
}
142
137
@@ -150,10 +145,9 @@ public function offsetGet($offset) {
150
145
* @return int The number of elements stored in the Array.
151
146
*
152
147
* @access public
153
- *
154
- * @author Michael Mulligan <michael@bigroomstudios.com>
155
148
*/
156
- public function count () {
149
+ public function count ()
150
+ {
157
151
return (int ) count ($ this ->data );
158
152
}
159
153
@@ -167,10 +161,9 @@ public function count() {
167
161
* @return mixed Data at the current position.
168
162
*
169
163
* @access public
170
- *
171
- * @author Michael Mulligan <michael@bigroomstudios.com>
172
164
*/
173
- public function current () {
165
+ public function current ()
166
+ {
174
167
return current ($ this ->data );
175
168
}
176
169
@@ -184,10 +177,9 @@ public function current() {
184
177
* @return void
185
178
*
186
179
* @access public
187
- *
188
- * @author Michael Mulligan <michael@bigroomstudios.com>
189
180
*/
190
- public function next () {
181
+ public function next ()
182
+ {
191
183
next ($ this ->data );
192
184
}
193
185
@@ -201,10 +193,9 @@ public function next() {
201
193
* @return mixed Case-Sensitive key at current position.
202
194
*
203
195
* @access public
204
- *
205
- * @author Michael Mulligan <michael@bigroomstudios.com>
206
196
*/
207
- public function key () {
197
+ public function key ()
198
+ {
208
199
$ key = key ($ this ->data );
209
200
return isset ($ this ->keys [$ key ]) ? $ this ->keys [$ key ] : $ key ;
210
201
}
@@ -219,10 +210,9 @@ public function key() {
219
210
* @return bool If the current position is valid.
220
211
*
221
212
* @access public
222
- *
223
- * @author Michael Mulligan <michael@bigroomstudios.com>
224
213
*/
225
- public function valid () {
214
+ public function valid ()
215
+ {
226
216
return (bool ) !(key ($ this ->data ) === NULL );
227
217
}
228
218
@@ -236,10 +226,9 @@ public function valid() {
236
226
* @return void
237
227
*
238
228
* @access public
239
- *
240
- * @author Michael Mulligan <michael@bigroomstudios.com>
241
229
*/
242
- public function rewind () {
230
+ public function rewind ()
231
+ {
243
232
reset ($ this ->data );
244
233
}
245
- }
234
+ }
0 commit comments