@@ -37,13 +37,13 @@ discard block |
||
| 37 | 37 | public function set($key, $value, $ttl = null) |
| 38 | 38 | { |
| 39 | 39 | //convert to timestamp from now. |
| 40 | - if ($ttl instanceof \DateInterval){ |
|
| 40 | + if ($ttl instanceof \DateInterval) { |
|
| 41 | 41 | $dateTime = new \DateTime(); |
| 42 | - $dateTime->add( $ttl ); |
|
| 42 | + $dateTime->add($ttl); |
|
| 43 | 43 | $ttl = $dateTime->getTimestamp() - time(); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if (!is_int($ttl) || $ttl === null){ |
|
| 46 | + if (!is_int($ttl) || $ttl === null) { |
|
| 47 | 47 | throw new InvalidArgumentException('$ttl can only be an instance of \DateInterval, int or null'); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | { |
| 87 | 87 | $this->_isValidKey($key); |
| 88 | 88 | |
| 89 | - if ($this->cache->has($key)){ |
|
| 89 | + if ($this->cache->has($key)) { |
|
| 90 | 90 | return $this->cache->get($key); |
| 91 | 91 | } |
| 92 | 92 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $this->_isTraversable($keys); |
| 128 | 128 | $result = []; |
| 129 | 129 | |
| 130 | - foreach ((array)$keys as $key){ |
|
| 130 | + foreach ((array)$keys as $key) { |
|
| 131 | 131 | $cachedItem = $this->cache->get($key); |
| 132 | 132 | $result[$key] = (null !== $cachedItem) ? $cachedItem : $default; |
| 133 | 133 | } |
@@ -155,11 +155,11 @@ discard block |
||
| 155 | 155 | $this->_isTraversable($values); |
| 156 | 156 | $results = []; |
| 157 | 157 | |
| 158 | - foreach ((array)$values as $key => $value){ |
|
| 158 | + foreach ((array)$values as $key => $value) { |
|
| 159 | 159 | $results[] = $this->cache->set($key, $value, $ttl); |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | - if ($this->_hasFailure($results)){ |
|
| 162 | + if ($this->_hasFailure($results)) { |
|
| 163 | 163 | return false; |
| 164 | 164 | } |
| 165 | 165 | |
@@ -182,11 +182,11 @@ discard block |
||
| 182 | 182 | $this->_isTraversable($keys); |
| 183 | 183 | $results = []; |
| 184 | 184 | |
| 185 | - foreach ((array)$keys as $key){ |
|
| 185 | + foreach ((array)$keys as $key) { |
|
| 186 | 186 | $results[] = $this->cache->delete($key); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - if ($this->_hasFailure($results)){ |
|
| 189 | + if ($this->_hasFailure($results)) { |
|
| 190 | 190 | return false; |
| 191 | 191 | } |
| 192 | 192 | |
@@ -209,8 +209,8 @@ discard block |
||
| 209 | 209 | * @param $key |
| 210 | 210 | * @throws InvalidArgumentException |
| 211 | 211 | */ |
| 212 | - private function _isValidKey($key){ |
|
| 213 | - if (!is_string($key)){ |
|
| 212 | + private function _isValidKey($key) { |
|
| 213 | + if (!is_string($key)) { |
|
| 214 | 214 | throw new InvalidArgumentException('provided key must be a valid string'); |
| 215 | 215 | } |
| 216 | 216 | } |
@@ -223,9 +223,9 @@ discard block |
||
| 223 | 223 | * @return bool |
| 224 | 224 | * @internal |
| 225 | 225 | */ |
| 226 | - private function _isTraversable($data){ |
|
| 226 | + private function _isTraversable($data) { |
|
| 227 | 227 | |
| 228 | - if (is_array($data) || $data instanceof \Traversable){ |
|
| 228 | + if (is_array($data) || $data instanceof \Traversable) { |
|
| 229 | 229 | return true; |
| 230 | 230 | } |
| 231 | 231 | |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | */ |
| 240 | 240 | private function _hasKeys(array $arr) |
| 241 | 241 | { |
| 242 | - if (array() === $arr || array_keys($arr) === range(0, count($arr) - 1)){ |
|
| 242 | + if (array() === $arr || array_keys($arr) === range(0, count($arr) - 1)) { |
|
| 243 | 243 | throw new InvalidArgumentException('Keys missing'); |
| 244 | 244 | } |
| 245 | 245 | |
@@ -253,8 +253,8 @@ discard block |
||
| 253 | 253 | * @return bool |
| 254 | 254 | * @internal |
| 255 | 255 | */ |
| 256 | - private function _hasFailure(array $results){ |
|
| 257 | - if (in_array(false, $results)){ |
|
| 256 | + private function _hasFailure(array $results) { |
|
| 257 | + if (in_array(false, $results)) { |
|
| 258 | 258 | return true; |
| 259 | 259 | } |
| 260 | 260 | return false; |
@@ -9,10 +9,10 @@ |
||
| 9 | 9 | * |
| 10 | 10 | * @package Tests\Cache\Mock |
| 11 | 11 | */ |
| 12 | -class IteratorMock implements \Iterator{ |
|
| 13 | - public function current(){} |
|
| 14 | - public function next(){} |
|
| 15 | - public function key(){} |
|
| 16 | - public function valid(){} |
|
| 17 | - public function rewind(){} |
|
| 12 | +class IteratorMock implements \Iterator { |
|
| 13 | + public function current() {} |
|
| 14 | + public function next() {} |
|
| 15 | + public function key() {} |
|
| 16 | + public function valid() {} |
|
| 17 | + public function rewind() {} |
|
| 18 | 18 | } |
@@ -11,10 +11,10 @@ |
||
| 11 | 11 | * |
| 12 | 12 | * @package Tests\Cache\Mock |
| 13 | 13 | */ |
| 14 | -class AbstractStorageMock extends AbstractStorage{ |
|
| 15 | - public function set($key, $value, $ttl = null){} |
|
| 16 | - public function has($key){} |
|
| 17 | - public function get($key){} |
|
| 18 | - public function delete($key){} |
|
| 19 | - public function clear(){} |
|
| 14 | +class AbstractStorageMock extends AbstractStorage { |
|
| 15 | + public function set($key, $value, $ttl = null) {} |
|
| 16 | + public function has($key) {} |
|
| 17 | + public function get($key) {} |
|
| 18 | + public function delete($key) {} |
|
| 19 | + public function clear() {} |
|
| 20 | 20 | } |
| 21 | 21 | \ No newline at end of file |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | /** |
| 37 | 37 | * Test that array has keys. |
| 38 | 38 | */ |
| 39 | - public function testArrayHasKeys(){ |
|
| 39 | + public function testArrayHasKeys() { |
|
| 40 | 40 | $data = ['a' => 'foo', 'b' => 'bar']; |
| 41 | 41 | $method = $this->getCacheMethod('_hasKeys'); |
| 42 | 42 | $actual = $method->invokeArgs($this->cache, [$data]); |
@@ -46,9 +46,9 @@ discard block |
||
| 46 | 46 | /** |
| 47 | 47 | * Test exception thrown when array is missing keys. |
| 48 | 48 | */ |
| 49 | - public function testArrayHasNoKeys(){ |
|
| 49 | + public function testArrayHasNoKeys() { |
|
| 50 | 50 | $this->expectException(InvalidArgumentException::class); |
| 51 | - $data = ['foo','bar']; |
|
| 51 | + $data = ['foo', 'bar']; |
|
| 52 | 52 | $method = $this->getCacheMethod('_hasKeys'); |
| 53 | 53 | $method->invokeArgs($this->cache, [$data]); |
| 54 | 54 | } |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | /** |
| 57 | 57 | * Test array contains a failure. |
| 58 | 58 | */ |
| 59 | - public function testHasFailure(){ |
|
| 60 | - $results = [true,true,true,false,true]; |
|
| 59 | + public function testHasFailure() { |
|
| 60 | + $results = [true, true, true, false, true]; |
|
| 61 | 61 | $method = $this->getCacheMethod('_hasFailure'); |
| 62 | 62 | $actual = $method->invokeArgs($this->cache, [$results]); |
| 63 | 63 | $expected = true; |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | /** |
| 68 | 68 | * |
| 69 | 69 | */ |
| 70 | - public function testHasNoFailure(){ |
|
| 71 | - $results = [true,true,true,true,true]; |
|
| 70 | + public function testHasNoFailure() { |
|
| 71 | + $results = [true, true, true, true, true]; |
|
| 72 | 72 | $method = $this->getCacheMethod('_hasFailure'); |
| 73 | 73 | $actual = $method->invokeArgs($this->cache, [$results]); |
| 74 | 74 | $expected = false; |
@@ -78,8 +78,8 @@ discard block |
||
| 78 | 78 | /** |
| 79 | 79 | * Test that array is Traversable |
| 80 | 80 | */ |
| 81 | - public function testIsTraversable(){ |
|
| 82 | - $data = ['a','b','c','d']; |
|
| 81 | + public function testIsTraversable() { |
|
| 82 | + $data = ['a', 'b', 'c', 'd']; |
|
| 83 | 83 | $method = $this->getCacheMethod('_isTraversable'); |
| 84 | 84 | $actual = $method->invokeArgs($this->cache, [$data]); |
| 85 | 85 | $expected = true; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | /** |
| 90 | 90 | * Test that string is not Traversable |
| 91 | 91 | */ |
| 92 | - public function testIsNotTraversable(){ |
|
| 92 | + public function testIsNotTraversable() { |
|
| 93 | 93 | $this->expectException(InvalidArgumentException::class); |
| 94 | 94 | $data = 'some-random-string'; |
| 95 | 95 | $method = $this->getCacheMethod('_isTraversable'); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | /** |
| 100 | 100 | * Test that instance of Iterator is traversable |
| 101 | 101 | */ |
| 102 | - public function testIsTraversableIterator(){ |
|
| 102 | + public function testIsTraversableIterator() { |
|
| 103 | 103 | $iterator = new IteratorMock(); |
| 104 | 104 | $method = $this->getCacheMethod('_isTraversable'); |
| 105 | 105 | $actual = $method->invokeArgs($this->cache, [$iterator]); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * @param $method |
| 113 | 113 | * @return \ReflectionMethod |
| 114 | 114 | */ |
| 115 | - private function getCacheMethod($method){ |
|
| 115 | + private function getCacheMethod($method) { |
|
| 116 | 116 | $reflector = new \ReflectionClass('\Ds\Cache\Cache'); |
| 117 | 117 | $method = $reflector->getMethod($method); |
| 118 | 118 | $method->setAccessible(true); |
@@ -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,12 +330,12 @@ discard block |
||
| 330 | 330 | /** |
| 331 | 331 | * |
| 332 | 332 | */ |
| 333 | - public function testDeleteMultipleFailure(){ |
|
| 334 | - $keys = ['foo','bar','baz']; |
|
| 333 | + public function testDeleteMultipleFailure() { |
|
| 334 | + $keys = ['foo', 'bar', 'baz']; |
|
| 335 | 335 | $expected = false; |
| 336 | 336 | $deleteStatus = true; |
| 337 | - foreach ($keys as $i => $key){ |
|
| 338 | - if ($i === 1){ |
|
| 337 | + foreach ($keys as $i => $key) { |
|
| 338 | + if ($i === 1) { |
|
| 339 | 339 | $deleteStatus = false; |
| 340 | 340 | } |
| 341 | 341 | $this->storageMock->expects($this->at($i)) |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | /** |
| 353 | 353 | * Test that storage clear is called. |
| 354 | 354 | */ |
| 355 | - public function testclear(){ |
|
| 355 | + public function testclear() { |
|
| 356 | 356 | $this->storageMock |
| 357 | 357 | ->expects($this->once()) |
| 358 | 358 | ->method('clear'); |
@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function setUp() |
| 31 | 31 | { |
| 32 | - $this->testDir = __DIR__ . '/cacheTest'; |
|
| 33 | - $this->cacheStorage = new FileStorage( $this->testDir, new \DateInterval('P1M')); |
|
| 32 | + $this->testDir = __DIR__.'/cacheTest'; |
|
| 33 | + $this->cacheStorage = new FileStorage($this->testDir, new \DateInterval('P1M')); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | /** |
| 46 | 46 | * Test that CacheException is thrown if directory is not valid/writable. |
| 47 | 47 | */ |
| 48 | - public function testUnwritableDirectory(){ |
|
| 48 | + public function testUnwritableDirectory() { |
|
| 49 | 49 | |
| 50 | 50 | $this->expectException(CacheException::class); |
| 51 | 51 | $this->cacheStorage = new FileStorage('php://memory', new \DateInterval('P1M')); |
@@ -54,68 +54,68 @@ discard block |
||
| 54 | 54 | /** |
| 55 | 55 | * Test that set is called. |
| 56 | 56 | */ |
| 57 | - public function testSet(){ |
|
| 58 | - $actual = $this->cacheStorage->set('key','value',60*60); |
|
| 57 | + public function testSet() { |
|
| 58 | + $actual = $this->cacheStorage->set('key', 'value', 60 * 60); |
|
| 59 | 59 | $this->assertEquals(true, $actual); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * Test has when not value is found. |
| 64 | 64 | */ |
| 65 | - public function testHasNoValue(){ |
|
| 65 | + public function testHasNoValue() { |
|
| 66 | 66 | $this->assertEquals($this->cacheStorage->has('someRandomKey'), false); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | 70 | * Test has when value is found. |
| 71 | 71 | */ |
| 72 | - public function testHas(){ |
|
| 73 | - $this->cacheStorage->set('foo','bar'); |
|
| 72 | + public function testHas() { |
|
| 73 | + $this->cacheStorage->set('foo', 'bar'); |
|
| 74 | 74 | $this->assertEquals($this->cacheStorage->has('foo'), true); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * Test has when value is found but has expired. |
| 79 | 79 | */ |
| 80 | - public function testHasExpired(){ |
|
| 81 | - $this->cacheStorage->set('expired','bar', -1200); |
|
| 80 | + public function testHasExpired() { |
|
| 81 | + $this->cacheStorage->set('expired', 'bar', -1200); |
|
| 82 | 82 | $this->assertEquals($this->cacheStorage->has('expired'), false); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | 86 | * Test that clear is called. |
| 87 | 87 | */ |
| 88 | - public function testClear(){ |
|
| 88 | + public function testClear() { |
|
| 89 | 89 | $this->assertEquals($this->cacheStorage->clear(), true); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | 93 | * Test that get returns a found key. |
| 94 | 94 | */ |
| 95 | - public function testGet(){ |
|
| 95 | + public function testGet() { |
|
| 96 | 96 | $expected = 'bat'; |
| 97 | - $this->cacheStorage->set('baz',$expected); |
|
| 97 | + $this->cacheStorage->set('baz', $expected); |
|
| 98 | 98 | $actual = $this->cacheStorage->get('baz'); |
| 99 | 99 | $this->assertEquals($expected, $actual); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - public function testDelete(){ |
|
| 102 | + public function testDelete() { |
|
| 103 | 103 | $this->cacheStorage->delete('baz'); |
| 104 | 104 | $this->assertEquals($this->cacheStorage->has('baz'), false); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - public function testCreateCacheItem(){ |
|
| 107 | + public function testCreateCacheItem() { |
|
| 108 | 108 | |
| 109 | 109 | $reflector = new \ReflectionClass(FileStorage::class); |
| 110 | 110 | $method = $reflector->getMethod('_createCacheItem'); |
| 111 | 111 | $method->setAccessible(true); |
| 112 | 112 | |
| 113 | - $key= 'my-key_+'; |
|
| 113 | + $key = 'my-key_+'; |
|
| 114 | 114 | $value = 'my-value'; |
| 115 | 115 | $ttl = 60 * 60 * 7; |
| 116 | 116 | |
| 117 | 117 | $expected = [ |
| 118 | - 'file' => $this->testDir . DIRECTORY_SEPARATOR . implode('.',[$key, FileStorage::EXTENSION]), |
|
| 118 | + 'file' => $this->testDir.DIRECTORY_SEPARATOR.implode('.', [$key, FileStorage::EXTENSION]), |
|
| 119 | 119 | 'data' => json_encode([$ttl, $value]) |
| 120 | 120 | ]; |
| 121 | 121 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $this->assertEquals($expected, $actual); |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - public function testCreateCacheItemInvalidKey(){ |
|
| 126 | + public function testCreateCacheItemInvalidKey() { |
|
| 127 | 127 | |
| 128 | 128 | $this->expectException(InvalidArgumentException::class); |
| 129 | 129 | $reflector = new \ReflectionClass(FileStorage::class); |
@@ -135,18 +135,18 @@ discard block |
||
| 135 | 135 | $method->invokeArgs($this->cacheStorage, [$key, $value, $ttl]); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - public function testFetchCacheNoItem(){ |
|
| 138 | + public function testFetchCacheNoItem() { |
|
| 139 | 139 | $reflector = new \ReflectionClass(FileStorage::class); |
| 140 | 140 | $method = $reflector->getMethod('_fetchCacheFile'); |
| 141 | 141 | $method->setAccessible(true); |
| 142 | - $key= 'unknown'; |
|
| 142 | + $key = 'unknown'; |
|
| 143 | 143 | $actual = $method->invokeArgs($this->cacheStorage, [$key]); |
| 144 | 144 | $this->assertEquals(false, $actual); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - public function testFetchCacheValid(){ |
|
| 147 | + public function testFetchCacheValid() { |
|
| 148 | 148 | |
| 149 | - $key= 'my-item'; |
|
| 149 | + $key = 'my-item'; |
|
| 150 | 150 | $ttl = 60 * 60; |
| 151 | 151 | $value = 'some-value'; |
| 152 | 152 | |
@@ -164,8 +164,8 @@ discard block |
||
| 164 | 164 | $this->assertEquals($expected, $actual); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - public function testFetchCacheExpired(){ |
|
| 168 | - $key= 'my-item'; |
|
| 167 | + public function testFetchCacheExpired() { |
|
| 168 | + $key = 'my-item'; |
|
| 169 | 169 | $ttl = -1500; |
| 170 | 170 | $value = 'some-value'; |
| 171 | 171 | $this->cacheStorage->set($key, $value, $ttl); |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | { |
| 184 | 184 | $dir = $this->testDir; |
| 185 | 185 | |
| 186 | - if (is_dir( $dir)){ |
|
| 186 | + if (is_dir($dir)) { |
|
| 187 | 187 | array_map('unlink', glob("$dir/*.*")); |
| 188 | 188 | } |
| 189 | 189 | \rmdir($dir); |