@@ -25,21 +25,21 @@ |
||
25 | 25 | $actOnAll = new ActOnAll(); |
26 | 26 | $statsAry = $actOnAll->getStats(); |
27 | 27 | |
28 | -if(is_array($statsAry)){ |
|
29 | - if(count($statsAry) !== 3){ |
|
28 | +if (is_array($statsAry)) { |
|
29 | + if (count($statsAry) !== 3) { |
|
30 | 30 | $status = 1; |
31 | 31 | echo 'Wrong count of driverStatistics objects: Got ' . count($statsAry) . " element(s), expected 3\n"; |
32 | 32 | goto endOfTest; |
33 | 33 | } |
34 | 34 | |
35 | 35 | foreach ($statsAry as $stat) { |
36 | - if(!is_object($stat) || !($stat instanceof driverStatistic)){ |
|
36 | + if (!is_object($stat) || !($stat instanceof driverStatistic)) { |
|
37 | 37 | echo "\$statsAry contains one element that is not an driverStatistic object\n"; |
38 | 38 | goto endOfTest; |
39 | 39 | } |
40 | 40 | } |
41 | 41 | echo "[PASS] ActOnAll helper passed all tests\n"; |
42 | -}else{ |
|
42 | +} else { |
|
43 | 43 | $status = 1; |
44 | 44 | echo "\$statsAry is not an array\n"; |
45 | 45 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | if (!class_exists('phpFastCache\CacheManager')) { |
16 | 16 | echo "[FAIL] Autoload failed to find the CacheManager\n"; |
17 | 17 | $status = 255; |
18 | -}else{ |
|
18 | +} else{ |
|
19 | 19 | echo "[PASS] Autoload successfully found the CacheManager\n"; |
20 | 20 | } |
21 | 21 |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | $status = 0; |
17 | 17 | echo "Testing EventManager\n"; |
18 | 18 | |
19 | -EventManager::getInstance()->onCacheSaveItem(function(ExtendedCacheItemPoolInterface $itemPool, ExtendedCacheItemInterface $item){ |
|
20 | - if($item->get() === 1000){ |
|
19 | +EventManager::getInstance()->onCacheSaveItem(function(ExtendedCacheItemPoolInterface $itemPool, ExtendedCacheItemInterface $item) { |
|
20 | + if ($item->get() === 1000) { |
|
21 | 21 | $item->increment(337); |
22 | 22 | } |
23 | 23 | }); |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | $cacheInstance->save($item); |
31 | 31 | |
32 | 32 | |
33 | -if($cacheInstance->getItem($cacheKey)->get() === 1337){ |
|
33 | +if ($cacheInstance->getItem($cacheKey)->get() === 1337) { |
|
34 | 34 | echo "[PASS] The dispatched event executed the custom callback to alter to item.\n"; |
35 | -}else{ |
|
35 | +} else { |
|
36 | 36 | echo "[FAIL] The dispatched event did not worked well, the expected value '1337', got '" . (int) $cacheInstance->getItem($cacheKey)->get() . "'\n"; |
37 | 37 | $status = 1; |
38 | 38 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | if (!class_exists('phpFastCache\CacheManager')) { |
16 | 16 | echo "[FAIL] Autoload failed to find the CacheManager\n"; |
17 | 17 | $status = 255; |
18 | -}else{ |
|
18 | +} else{ |
|
19 | 19 | echo "[PASS] Autoload successfully found the CacheManager\n"; |
20 | 20 | } |
21 | 21 |