@@ -75,10 +75,10 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function setCapacity($capacity) |
| 77 | 77 | { |
| 78 | - if(!is_int($capacity)) |
|
| 78 | + if (!is_int($capacity)) |
|
| 79 | 79 | throw new InvalidCapacityException(); |
| 80 | 80 | |
| 81 | - if($this->count() > $capacity) |
|
| 81 | + if ($this->count() > $capacity) |
|
| 82 | 82 | throw new InvalidCapacityException(); |
| 83 | 83 | |
| 84 | 84 | $this->capacity = $capacity; |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $storage->clear(); |
| 109 | 109 | |
| 110 | 110 | $this->each(function($item, $key) use(&$storage, $callback){ |
| 111 | - if($callback($item, $key) === true) |
|
| 111 | + if ($callback($item, $key) === true) |
|
| 112 | 112 | $storage[$key] = $item; |
| 113 | 113 | }); |
| 114 | 114 | |
@@ -124,8 +124,8 @@ discard block |
||
| 124 | 124 | public function copyTo(&$array, $override = true) |
| 125 | 125 | { |
| 126 | 126 | $this->each(function($item, $key) use(&$array, $override){ |
| 127 | - if(!$override && isset($array[$key])) |
|
| 128 | - return ; |
|
| 127 | + if (!$override && isset($array[$key])) |
|
| 128 | + return; |
|
| 129 | 129 | |
| 130 | 130 | $array[$key] = $item; |
| 131 | 131 | }); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | public function clear() |
| 140 | 140 | { |
| 141 | - if($this->isReadOnly()) |
|
| 141 | + if ($this->isReadOnly()) |
|
| 142 | 142 | throw new ReadOnlyStorageException(); |
| 143 | 143 | |
| 144 | 144 | $this->storage = array(); |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | public function offsetGet($offset) |
| 248 | 248 | { |
| 249 | - if(!$this->offsetExists($offset)) |
|
| 249 | + if (!$this->offsetExists($offset)) |
|
| 250 | 250 | throw new InvalidOffsetException(); |
| 251 | 251 | |
| 252 | 252 | return $this->storage[$offset]; |
@@ -269,10 +269,10 @@ discard block |
||
| 269 | 269 | */ |
| 270 | 270 | public function offsetSet($offset, $value) |
| 271 | 271 | { |
| 272 | - if($this->isReadOnly()) |
|
| 272 | + if ($this->isReadOnly()) |
|
| 273 | 273 | throw new ReadOnlyStorageException(); |
| 274 | 274 | |
| 275 | - if($this->count() === $this->getCapacity()) |
|
| 275 | + if ($this->count() === $this->getCapacity()) |
|
| 276 | 276 | throw new MaxCapacityReachedException(); |
| 277 | 277 | |
| 278 | 278 | $this->storage[$offset] = $value; |
@@ -291,10 +291,10 @@ discard block |
||
| 291 | 291 | */ |
| 292 | 292 | public function offsetUnset($offset) |
| 293 | 293 | { |
| 294 | - if(!$this->offsetExists($offset)) |
|
| 294 | + if (!$this->offsetExists($offset)) |
|
| 295 | 295 | throw new InvalidOffsetException(); |
| 296 | 296 | |
| 297 | - if($this->isReadOnly()) |
|
| 297 | + if ($this->isReadOnly()) |
|
| 298 | 298 | throw new ReadOnlyStorageException(); |
| 299 | 299 | |
| 300 | 300 | unset($this->storage[$offset]); |