@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | $testHelper->printNewLine()->printText('Setting up value to "test-key, test-key2, test-key3"...')->printNewLine(); |
| 45 | 45 | $Psr16Adapter->setMultiple([ |
| 46 | - 'test-key' => $value, |
|
| 47 | - 'test-key2' => $value, |
|
| 48 | - 'test-key3' => $value |
|
| 46 | + 'test-key' => $value, |
|
| 47 | + 'test-key2' => $value, |
|
| 48 | + 'test-key3' => $value |
|
| 49 | 49 | ]); |
| 50 | 50 | |
| 51 | 51 | |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | $testHelper->printNewLine()->printText('Setting up value to "test-key, test-key2, test-key3"...')->printNewLine(); |
| 63 | 63 | $Psr16Adapter->setMultiple([ |
| 64 | - 'test-key' => $value, |
|
| 65 | - 'test-key2' => $value, |
|
| 66 | - 'test-key3' => $value |
|
| 64 | + 'test-key' => $value, |
|
| 65 | + 'test-key2' => $value, |
|
| 66 | + 'test-key3' => $value |
|
| 67 | 67 | ]); |
| 68 | 68 | |
| 69 | 69 | if($Psr16Adapter->has('test-key') && $Psr16Adapter->has('test-key2') && $Psr16Adapter->has('test-key3')){ |
@@ -17,27 +17,27 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | $value = str_shuffle(uniqid('pfc', true)); |
| 19 | 19 | |
| 20 | -if(!$Psr16Adapter->has('test-key')){ |
|
| 20 | +if (!$Psr16Adapter->has('test-key')) { |
|
| 21 | 21 | $testHelper->printPassText('1/6 Psr16 hasser returned expected boolean (false)'); |
| 22 | -}else{ |
|
| 22 | +} else { |
|
| 23 | 23 | $testHelper->printFailText('1/6 Psr16 hasser returned unexpected boolean (true)'); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | $testHelper->printNewLine()->printText('Setting up value to "test-key"...')->printNewLine(); |
| 27 | 27 | $Psr16Adapter->set('test-key', $value); |
| 28 | 28 | |
| 29 | -if($Psr16Adapter->get('test-key') === $value){ |
|
| 29 | +if ($Psr16Adapter->get('test-key') === $value) { |
|
| 30 | 30 | $testHelper->printPassText('2/6 Psr16 getter returned expected value: ' . $value); |
| 31 | -}else{ |
|
| 31 | +} else { |
|
| 32 | 32 | $testHelper->printFailText('2/6 Psr16 getter returned unexpected value: ' . $value); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | $testHelper->printNewLine()->printText('Deleting key "test-key"...')->printNewLine(); |
| 36 | 36 | $Psr16Adapter->delete('test-key', $value); |
| 37 | 37 | |
| 38 | -if(!$Psr16Adapter->has('test-key')){ |
|
| 38 | +if (!$Psr16Adapter->has('test-key')) { |
|
| 39 | 39 | $testHelper->printPassText('3/6 Psr16 hasser returned expected boolean (false)'); |
| 40 | -}else{ |
|
| 40 | +} else { |
|
| 41 | 41 | $testHelper->printFailText('3/6 Psr16 hasser returned unexpected boolean (true)'); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | $values = $Psr16Adapter->getMultiple(['test-key', 'test-key2', 'test-key3']); |
| 53 | -if(count(array_filter($values)) === 3){ |
|
| 53 | +if (count(array_filter($values)) === 3) { |
|
| 54 | 54 | $testHelper->printPassText('4/6 Psr16 multiple getters returned expected values (3)'); |
| 55 | -}else{ |
|
| 55 | +} else { |
|
| 56 | 56 | $testHelper->printFailText('4/6 Psr16 getters(3) returned unexpected values.'); |
| 57 | 57 | } |
| 58 | 58 | |
@@ -66,18 +66,18 @@ discard block |
||
| 66 | 66 | 'test-key3' => $value |
| 67 | 67 | ]); |
| 68 | 68 | |
| 69 | -if($Psr16Adapter->has('test-key') && $Psr16Adapter->has('test-key2') && $Psr16Adapter->has('test-key3')){ |
|
| 69 | +if ($Psr16Adapter->has('test-key') && $Psr16Adapter->has('test-key2') && $Psr16Adapter->has('test-key3')) { |
|
| 70 | 70 | $testHelper->printPassText('5/6 Psr16 hasser returned expected booleans (true)'); |
| 71 | -}else{ |
|
| 71 | +} else { |
|
| 72 | 72 | $testHelper->printFailText('5/6 Psr16 hasser returned one or more unexpected boolean (false)'); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | $testHelper->printNewLine()->printText('Deleting up keys "test-key, test-key2, test-key3"...')->printNewLine(); |
| 76 | 76 | $Psr16Adapter->deleteMultiple(['test-key', 'test-key2', 'test-key3']); |
| 77 | 77 | |
| 78 | -if(!$Psr16Adapter->has('test-key') && !$Psr16Adapter->has('test-key2') && !$Psr16Adapter->has('test-key3')){ |
|
| 78 | +if (!$Psr16Adapter->has('test-key') && !$Psr16Adapter->has('test-key2') && !$Psr16Adapter->has('test-key3')) { |
|
| 79 | 79 | $testHelper->printPassText('6/6 Psr16 hasser returned expected booleans (false)'); |
| 80 | -}else{ |
|
| 80 | +} else { |
|
| 81 | 81 | $testHelper->printFailText('6/6 Psr16 hasser returned one or more unexpected boolean (true)'); |
| 82 | 82 | } |
| 83 | 83 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | if(!$Psr16Adapter->has('test-key')){ |
| 21 | 21 | $testHelper->printPassText('1/6 Psr16 hasser returned expected boolean (false)'); |
| 22 | -}else{ |
|
| 22 | +} else{ |
|
| 23 | 23 | $testHelper->printFailText('1/6 Psr16 hasser returned unexpected boolean (true)'); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | if($Psr16Adapter->get('test-key') === $value){ |
| 30 | 30 | $testHelper->printPassText('2/6 Psr16 getter returned expected value: ' . $value); |
| 31 | -}else{ |
|
| 31 | +} else{ |
|
| 32 | 32 | $testHelper->printFailText('2/6 Psr16 getter returned unexpected value: ' . $value); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | if(!$Psr16Adapter->has('test-key')){ |
| 39 | 39 | $testHelper->printPassText('3/6 Psr16 hasser returned expected boolean (false)'); |
| 40 | -}else{ |
|
| 40 | +} else{ |
|
| 41 | 41 | $testHelper->printFailText('3/6 Psr16 hasser returned unexpected boolean (true)'); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $values = $Psr16Adapter->getMultiple(['test-key', 'test-key2', 'test-key3']); |
| 53 | 53 | if(count(array_filter($values)) === 3){ |
| 54 | 54 | $testHelper->printPassText('4/6 Psr16 multiple getters returned expected values (3)'); |
| 55 | -}else{ |
|
| 55 | +} else{ |
|
| 56 | 56 | $testHelper->printFailText('4/6 Psr16 getters(3) returned unexpected values.'); |
| 57 | 57 | } |
| 58 | 58 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | if($Psr16Adapter->has('test-key') && $Psr16Adapter->has('test-key2') && $Psr16Adapter->has('test-key3')){ |
| 70 | 70 | $testHelper->printPassText('5/6 Psr16 hasser returned expected booleans (true)'); |
| 71 | -}else{ |
|
| 71 | +} else{ |
|
| 72 | 72 | $testHelper->printFailText('5/6 Psr16 hasser returned one or more unexpected boolean (false)'); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | if(!$Psr16Adapter->has('test-key') && !$Psr16Adapter->has('test-key2') && !$Psr16Adapter->has('test-key3')){ |
| 79 | 79 | $testHelper->printPassText('6/6 Psr16 hasser returned expected booleans (false)'); |
| 80 | -}else{ |
|
| 80 | +} else{ |
|
| 81 | 81 | $testHelper->printFailText('6/6 Psr16 hasser returned one or more unexpected boolean (true)'); |
| 82 | 82 | } |
| 83 | 83 | |
@@ -63,8 +63,8 @@ |
||
| 63 | 63 | { |
| 64 | 64 | try { |
| 65 | 65 | $cacheItem = $this->internalCacheInstance |
| 66 | - ->getItem($key) |
|
| 67 | - ->set($value); |
|
| 66 | + ->getItem($key) |
|
| 67 | + ->set($value); |
|
| 68 | 68 | if (is_int($ttl) || $ttl instanceof \DateInterval) { |
| 69 | 69 | $cacheItem->expiresAfter($ttl); |
| 70 | 70 | } |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | public function getMultiple($keys, $default = null) |
| 111 | 111 | { |
| 112 | 112 | try { |
| 113 | - return array_map(function (ExtendedCacheItemInterface $item) { |
|
| 113 | + return array_map(function(ExtendedCacheItemInterface $item) { |
|
| 114 | 114 | return $item->get(); |
| 115 | 115 | }, $this->internalCacheInstance->getItems($keys)); |
| 116 | 116 | } catch (phpFastCacheInvalidArgumentException $e) { |
@@ -18,9 +18,9 @@ discard block |
||
| 18 | 18 | /** |
| 19 | 19 | * Register Autoload |
| 20 | 20 | */ |
| 21 | -spl_autoload_register(function ($entity) { |
|
| 21 | +spl_autoload_register(function($entity) { |
|
| 22 | 22 | $module = explode('\\', $entity, 2); |
| 23 | - if (!in_array($module[ 0 ], ['phpFastCache', 'Psr'])) { |
|
| 23 | + if (!in_array($module[0], ['phpFastCache', 'Psr'])) { |
|
| 24 | 24 | /** |
| 25 | 25 | * Not a part of phpFastCache file |
| 26 | 26 | * then we return here. |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | if (is_readable($path)) { |
| 33 | 33 | require_once $path; |
| 34 | - }else{ |
|
| 34 | + } else { |
|
| 35 | 35 | trigger_error('Cannot locate the Psr/Cache files', E_USER_ERROR); |
| 36 | 36 | } |
| 37 | 37 | return; |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | if (is_readable($path)) { |
| 42 | 42 | require_once $path; |
| 43 | - }else{ |
|
| 43 | + } else { |
|
| 44 | 44 | trigger_error('Cannot locate the Psr/SimpleCache files', E_USER_ERROR); |
| 45 | 45 | } |
| 46 | 46 | return; |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | flock($f, LOCK_UN); |
| 120 | 120 | fclose($f); |
| 121 | 121 | rename($tmpFilename, $file); |
| 122 | - }else{ |
|
| 122 | + } else{ |
|
| 123 | 123 | $f = fopen($file, 'w+'); |
| 124 | 124 | $octetWritten = fwrite($f, $data); |
| 125 | 125 | fclose($f); |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | * reuse it else set a new Date |
| 209 | 209 | */ |
| 210 | 210 | $wrap[ self::DRIVER_CDATE_WRAPPER_INDEX ] = $item->getCreationDate() ?: new \DateTime(); |
| 211 | - }else{ |
|
| 211 | + } else{ |
|
| 212 | 212 | $wrap[ self::DRIVER_MDATE_WRAPPER_INDEX ] = null; |
| 213 | 213 | $wrap[ self::DRIVER_CDATE_WRAPPER_INDEX ] = null; |
| 214 | 214 | } |