Skip to content

Commit 42ecf9c

Browse files
committed
1 parent 425daed commit 42ecf9c

File tree

1 file changed

+27
-38
lines changed

1 file changed

+27
-38
lines changed

src/Curl/CaseInsensitiveArray.php

Lines changed: 27 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
namespace Curl;
44

5-
class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator {
5+
class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator
6+
{
67

78
/**
89
* @var mixed[] Data storage with lower-case keys
@@ -37,12 +38,11 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator {
3738
* @return void
3839
*
3940
* @access public
40-
*
41-
* @author Michael Mulligan <michael@bigroomstudios.com>
4241
*/
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) {
4646
$this->offsetSet($key, $value);
4747
}
4848
}
@@ -63,10 +63,9 @@ public function __construct(Array $initial = NULL) {
6363
* @return void
6464
*
6565
* @access public
66-
*
67-
* @author Michael Mulligan <michael@bigroomstudios.com>
6866
*/
69-
public function offsetSet($offset, $value) {
67+
public function offsetSet($offset, $value)
68+
{
7069
if ($offset === null) {
7170
$this->data[] = $value;
7271
} else {
@@ -89,10 +88,9 @@ public function offsetSet($offset, $value) {
8988
* @return bool If the offset exists.
9089
*
9190
* @access public
92-
*
93-
* @author Michael Mulligan <michael@bigroomstudios.com>
9491
*/
95-
public function offsetExists($offset) {
92+
public function offsetExists($offset)
93+
{
9694
return (bool) array_key_exists(strtolower($offset), $this->data);
9795
}
9896

@@ -109,10 +107,9 @@ public function offsetExists($offset) {
109107
* @return void
110108
*
111109
* @access public
112-
*
113-
* @author Michael Mulligan <michael@bigroomstudios.com>
114110
*/
115-
public function offsetUnset($offset) {
111+
public function offsetUnset($offset)
112+
{
116113
$offsetlower = strtolower($offset);
117114
unset($this->data[$offsetlower]);
118115
unset($this->keys[$offsetlower]);
@@ -131,12 +128,10 @@ public function offsetUnset($offset) {
131128
* @return mixed The data stored at the offset.
132129
*
133130
* @access public
134-
*
135-
* @author Michael Mulligan <michael@bigroomstudios.com>
136131
*/
137-
public function offsetGet($offset) {
132+
public function offsetGet($offset)
133+
{
138134
$offsetlower = strtolower($offset);
139-
// As isset() is false on 'NULL' anyway, use it, and return NULL, faster
140135
return isset($this->data[$offsetlower]) ? $this->data[$offsetlower] : NULL;
141136
}
142137

@@ -150,10 +145,9 @@ public function offsetGet($offset) {
150145
* @return int The number of elements stored in the Array.
151146
*
152147
* @access public
153-
*
154-
* @author Michael Mulligan <michael@bigroomstudios.com>
155148
*/
156-
public function count() {
149+
public function count()
150+
{
157151
return (int) count($this->data);
158152
}
159153

@@ -167,10 +161,9 @@ public function count() {
167161
* @return mixed Data at the current position.
168162
*
169163
* @access public
170-
*
171-
* @author Michael Mulligan <michael@bigroomstudios.com>
172164
*/
173-
public function current() {
165+
public function current()
166+
{
174167
return current($this->data);
175168
}
176169

@@ -184,10 +177,9 @@ public function current() {
184177
* @return void
185178
*
186179
* @access public
187-
*
188-
* @author Michael Mulligan <michael@bigroomstudios.com>
189180
*/
190-
public function next() {
181+
public function next()
182+
{
191183
next($this->data);
192184
}
193185

@@ -201,10 +193,9 @@ public function next() {
201193
* @return mixed Case-Sensitive key at current position.
202194
*
203195
* @access public
204-
*
205-
* @author Michael Mulligan <michael@bigroomstudios.com>
206196
*/
207-
public function key() {
197+
public function key()
198+
{
208199
$key = key($this->data);
209200
return isset($this->keys[$key]) ? $this->keys[$key] : $key;
210201
}
@@ -219,10 +210,9 @@ public function key() {
219210
* @return bool If the current position is valid.
220211
*
221212
* @access public
222-
*
223-
* @author Michael Mulligan <michael@bigroomstudios.com>
224213
*/
225-
public function valid() {
214+
public function valid()
215+
{
226216
return (bool) !(key($this->data) === NULL);
227217
}
228218

@@ -236,10 +226,9 @@ public function valid() {
236226
* @return void
237227
*
238228
* @access public
239-
*
240-
* @author Michael Mulligan <michael@bigroomstudios.com>
241229
*/
242-
public function rewind() {
230+
public function rewind()
231+
{
243232
reset($this->data);
244233
}
245-
}
234+
}

0 commit comments

Comments
 (0)