@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | $key = 21021000; |
| 41 | 41 | $this->expectException(InvalidArgumentException::class); |
| 42 | - $this->cache->set($key,'value'); |
|
| 42 | + $this->cache->set($key, 'value'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | /** |
| 206 | 206 | * |
| 207 | 207 | */ |
| 208 | - public function testGetMultiple(){ |
|
| 208 | + public function testGetMultiple() { |
|
| 209 | 209 | |
| 210 | 210 | $expected = [ |
| 211 | 211 | 'foo' => 'fooValue', |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | $i = 0; |
| 217 | 217 | |
| 218 | - foreach ($expected as $key => $value){ |
|
| 218 | + foreach ($expected as $key => $value) { |
|
| 219 | 219 | |
| 220 | 220 | $this->storageMock->expects($this->at($i)) |
| 221 | 221 | ->method('get') |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | /** |
| 236 | 236 | * |
| 237 | 237 | */ |
| 238 | - public function testSetMultiple(){ |
|
| 238 | + public function testSetMultiple() { |
|
| 239 | 239 | |
| 240 | 240 | $keys = [ |
| 241 | 241 | 'foo' => 'fooValue', |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $i = 0; |
| 250 | 250 | $expires = 60 * 60; |
| 251 | 251 | |
| 252 | - foreach ($keys as $key => $value){ |
|
| 252 | + foreach ($keys as $key => $value) { |
|
| 253 | 253 | $this->storageMock->expects($this->at($i)) |
| 254 | 254 | ->method('set') |
| 255 | 255 | ->with( |
@@ -261,14 +261,14 @@ discard block |
||
| 261 | 261 | $i++; |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | - $actual = $this->cache->setMultiple($keys,$expires); |
|
| 264 | + $actual = $this->cache->setMultiple($keys, $expires); |
|
| 265 | 265 | $this->assertEquals($expected, $actual); |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | /** |
| 269 | 269 | * |
| 270 | 270 | */ |
| 271 | - public function testSetMultipleWithFailure(){ |
|
| 271 | + public function testSetMultipleWithFailure() { |
|
| 272 | 272 | |
| 273 | 273 | $keys = [ |
| 274 | 274 | 'foo' => 'fooValue', |
@@ -282,11 +282,11 @@ discard block |
||
| 282 | 282 | $i = 0; |
| 283 | 283 | $expires = 60 * 60; |
| 284 | 284 | |
| 285 | - foreach ($keys as $key => $value){ |
|
| 285 | + foreach ($keys as $key => $value) { |
|
| 286 | 286 | |
| 287 | 287 | $status = $addStatus; |
| 288 | 288 | |
| 289 | - if ($i === 1){ |
|
| 289 | + if ($i === 1) { |
|
| 290 | 290 | $status = false; |
| 291 | 291 | } |
| 292 | 292 | |
@@ -301,20 +301,20 @@ discard block |
||
| 301 | 301 | $i++; |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | - $actual = $this->cache->setMultiple($keys,$expires); |
|
| 304 | + $actual = $this->cache->setMultiple($keys, $expires); |
|
| 305 | 305 | $this->assertEquals($expected, $actual); |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | /** |
| 309 | 309 | * |
| 310 | 310 | */ |
| 311 | - public function testDeleteMultiple(){ |
|
| 311 | + public function testDeleteMultiple() { |
|
| 312 | 312 | |
| 313 | - $keys = ['foo','bar','baz']; |
|
| 313 | + $keys = ['foo', 'bar', 'baz']; |
|
| 314 | 314 | $deleteStatus = true; |
| 315 | 315 | $expected = true; |
| 316 | 316 | |
| 317 | - foreach ($keys as $i => $key){ |
|
| 317 | + foreach ($keys as $i => $key) { |
|
| 318 | 318 | $this->storageMock->expects($this->at($i)) |
| 319 | 319 | ->method('delete') |
| 320 | 320 | ->with( |
@@ -330,15 +330,15 @@ discard block |
||
| 330 | 330 | /** |
| 331 | 331 | * |
| 332 | 332 | */ |
| 333 | - public function testDeleteMultipleFailure(){ |
|
| 333 | + public function testDeleteMultipleFailure() { |
|
| 334 | 334 | |
| 335 | - $keys = ['foo','bar','baz']; |
|
| 335 | + $keys = ['foo', 'bar', 'baz']; |
|
| 336 | 336 | $expected = false; |
| 337 | 337 | $deleteStatus = true; |
| 338 | 338 | |
| 339 | - foreach ($keys as $i => $key){ |
|
| 339 | + foreach ($keys as $i => $key) { |
|
| 340 | 340 | |
| 341 | - if ($i === 1){ |
|
| 341 | + if ($i === 1) { |
|
| 342 | 342 | $deleteStatus = false; |
| 343 | 343 | } |
| 344 | 344 | |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | /** |
| 358 | 358 | * Test that storage clear is called. |
| 359 | 359 | */ |
| 360 | - public function testclear(){ |
|
| 360 | + public function testclear() { |
|
| 361 | 361 | $this->storageMock->expects($this->once()) |
| 362 | 362 | ->method('clear'); |
| 363 | 363 | $this->cache->clear(); |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | /** |
| 367 | 367 | * Test that array has keys. |
| 368 | 368 | */ |
| 369 | - public function testArrayHasKeys(){ |
|
| 369 | + public function testArrayHasKeys() { |
|
| 370 | 370 | $data = ['a' => 'foo', 'b' => 'bar']; |
| 371 | 371 | |
| 372 | 372 | $reflector = new \ReflectionClass(Cache::class); |
@@ -380,9 +380,9 @@ discard block |
||
| 380 | 380 | /** |
| 381 | 381 | * Test exception thrown when array is missing keys. |
| 382 | 382 | */ |
| 383 | - public function testArrayHasNoKeys(){ |
|
| 383 | + public function testArrayHasNoKeys() { |
|
| 384 | 384 | $this->expectException(InvalidArgumentException::class); |
| 385 | - $data = ['foo','bar']; |
|
| 385 | + $data = ['foo', 'bar']; |
|
| 386 | 386 | $reflector = new \ReflectionClass(Cache::class); |
| 387 | 387 | $method = $reflector->getMethod('_hasKeys'); |
| 388 | 388 | $method->setAccessible(true); |
@@ -392,8 +392,8 @@ discard block |
||
| 392 | 392 | /** |
| 393 | 393 | * Test array contains a failure. |
| 394 | 394 | */ |
| 395 | - public function testHasFailure(){ |
|
| 396 | - $results = [true,true,true,false,true]; |
|
| 395 | + public function testHasFailure() { |
|
| 396 | + $results = [true, true, true, false, true]; |
|
| 397 | 397 | $reflector = new \ReflectionClass(Cache::class); |
| 398 | 398 | $method = $reflector->getMethod('_hasFailure'); |
| 399 | 399 | $method->setAccessible(true); |
@@ -405,8 +405,8 @@ discard block |
||
| 405 | 405 | /** |
| 406 | 406 | * Test array doesn't contain a failure. |
| 407 | 407 | */ |
| 408 | - public function testHasNoFailure(){ |
|
| 409 | - $results = [true,true,true,true,true]; |
|
| 408 | + public function testHasNoFailure() { |
|
| 409 | + $results = [true, true, true, true, true]; |
|
| 410 | 410 | $reflector = new \ReflectionClass(Cache::class); |
| 411 | 411 | $method = $reflector->getMethod('_hasFailure'); |
| 412 | 412 | $method->setAccessible(true); |
@@ -418,8 +418,8 @@ discard block |
||
| 418 | 418 | /** |
| 419 | 419 | * Test that array is Traversable |
| 420 | 420 | */ |
| 421 | - public function testIsTraversable(){ |
|
| 422 | - $data = ['a','b','c','d']; |
|
| 421 | + public function testIsTraversable() { |
|
| 422 | + $data = ['a', 'b', 'c', 'd']; |
|
| 423 | 423 | $reflector = new \ReflectionClass(Cache::class); |
| 424 | 424 | $method = $reflector->getMethod('_isTraversable'); |
| 425 | 425 | $method->setAccessible(true); |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | /** |
| 432 | 432 | * Test that string is not Traversable |
| 433 | 433 | */ |
| 434 | - public function testIsNotTraversable(){ |
|
| 434 | + public function testIsNotTraversable() { |
|
| 435 | 435 | $this->expectException(InvalidArgumentException::class); |
| 436 | 436 | $data = 'some-random-string'; |
| 437 | 437 | $reflector = new \ReflectionClass(Cache::class); |
@@ -443,13 +443,13 @@ discard block |
||
| 443 | 443 | /** |
| 444 | 444 | * Test that instance of Iterator is traversable |
| 445 | 445 | */ |
| 446 | - public function testIsTraversableIterator(){ |
|
| 446 | + public function testIsTraversableIterator() { |
|
| 447 | 447 | $iterator = new class implements \Iterator { |
| 448 | - public function current(){} |
|
| 449 | - public function next(){} |
|
| 450 | - public function key(){} |
|
| 451 | - public function valid(){} |
|
| 452 | - public function rewind(){} |
|
| 448 | + public function current() {} |
|
| 449 | + public function next() {} |
|
| 450 | + public function key() {} |
|
| 451 | + public function valid() {} |
|
| 452 | + public function rewind() {} |
|
| 453 | 453 | }; |
| 454 | 454 | $reflector = new \ReflectionClass(Cache::class); |
| 455 | 455 | $method = $reflector->getMethod('_isTraversable'); |