@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function offsetSet($offset, $value) |
61 | 61 | { |
62 | - if($this->offsetExists($offset) && !$this->isOverrideAllowed()) |
|
62 | + if ($this->offsetExists($offset) && !$this->isOverrideAllowed()) |
|
63 | 63 | throw new OverrideOperationException(); |
64 | 64 | |
65 | 65 | |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | { |
76 | 76 | $keys = []; |
77 | 77 | |
78 | - foreach ($this->storage as $key => $item){ |
|
78 | + foreach ($this->storage as $key => $item) { |
|
79 | 79 | $keys[] = $key; |
80 | 80 | } |
81 | 81 | |
82 | - if(isset($keys[$this->current])) |
|
82 | + if (isset($keys[$this->current])) |
|
83 | 83 | return $keys[$this->current]; |
84 | 84 | } |
85 | 85 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | */ |
41 | 41 | public function offsetSet($offset, $value) |
42 | 42 | { |
43 | - if(!is_int($offset)) |
|
43 | + if (!is_int($offset)) |
|
44 | 44 | throw new InvalidOffsetTypeException("Apenas inteiros são permitidos"); |
45 | 45 | |
46 | 46 | parent::offsetSet($offset, $value); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | private function validateOffsetType($offset) |
55 | 55 | { |
56 | - if(!is_bool($offset) |
|
56 | + if (!is_bool($offset) |
|
57 | 57 | && !is_int($offset) |
58 | 58 | && !is_float($offset) |
59 | 59 | && !is_string($offset)) |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function setCapacity($capacity) |
92 | 92 | { |
93 | - if(!is_int($capacity)) |
|
93 | + if (!is_int($capacity)) |
|
94 | 94 | throw new InvalidCapacityException(); |
95 | 95 | |
96 | - if($this->count() > $capacity) |
|
96 | + if ($this->count() > $capacity) |
|
97 | 97 | throw new InvalidCapacityException(); |
98 | 98 | |
99 | 99 | $this->capacity = $capacity; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $storage->clear(); |
124 | 124 | |
125 | 125 | $this->each(function($item, $key) use(&$storage, $callback){ |
126 | - if($callback($item, $key) === true) |
|
126 | + if ($callback($item, $key) === true) |
|
127 | 127 | $storage[$key] = $item; |
128 | 128 | }); |
129 | 129 | |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | public function copyTo(&$array, $override = true) |
140 | 140 | { |
141 | 141 | $this->each(function($item, $key) use(&$array, $override){ |
142 | - if(!$override && isset($array[$key])) |
|
143 | - return ; |
|
142 | + if (!$override && isset($array[$key])) |
|
143 | + return; |
|
144 | 144 | |
145 | 145 | $array[$key] = $item; |
146 | 146 | }); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | */ |
154 | 154 | public function clear() |
155 | 155 | { |
156 | - if($this->isReadOnly()) |
|
156 | + if ($this->isReadOnly()) |
|
157 | 157 | throw new ReadOnlyStorageException(); |
158 | 158 | |
159 | 159 | $this->storage = array(); |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | */ |
262 | 262 | public function offsetGet($offset) |
263 | 263 | { |
264 | - if(!$this->offsetExists($offset)) |
|
264 | + if (!$this->offsetExists($offset)) |
|
265 | 265 | throw new InvalidOffsetException(); |
266 | 266 | |
267 | 267 | return $this->storage[$offset]; |
@@ -284,10 +284,10 @@ discard block |
||
284 | 284 | */ |
285 | 285 | public function offsetSet($offset, $value) |
286 | 286 | { |
287 | - if($this->isReadOnly()) |
|
287 | + if ($this->isReadOnly()) |
|
288 | 288 | throw new ReadOnlyStorageException(); |
289 | 289 | |
290 | - if($this->count() === $this->getCapacity()) |
|
290 | + if ($this->count() === $this->getCapacity()) |
|
291 | 291 | throw new MaxCapacityReachedException(); |
292 | 292 | |
293 | 293 | $this->validateOffsetType($offset); |
@@ -307,10 +307,10 @@ discard block |
||
307 | 307 | */ |
308 | 308 | public function offsetUnset($offset) |
309 | 309 | { |
310 | - if(!$this->offsetExists($offset)) |
|
310 | + if (!$this->offsetExists($offset)) |
|
311 | 311 | throw new InvalidOffsetException(); |
312 | 312 | |
313 | - if($this->isReadOnly()) |
|
313 | + if ($this->isReadOnly()) |
|
314 | 314 | throw new ReadOnlyStorageException(); |
315 | 315 | |
316 | 316 | $this->validateOffsetType($offset); |