@@ -206,8 +206,7 @@ |
||
| 206 | 206 | private function storeCache(string $cacheKey, mixed $cacheData, string $namespace = '', int | string $ttl = 3600) |
| 207 | 207 | { |
| 208 | 208 | $data = $this->cacheRepository->store($cacheKey, $cacheData, $namespace, $ttl); |
| 209 | - return $data ? $this->setMessage("Cache Stored Successfully", true) : |
|
| 210 | - $this->setMessage("Already exists a cache with this key...", false); |
|
| 209 | + return $data ? $this->setMessage("Cache Stored Successfully", true) : $this->setMessage("Already exists a cache with this key...", false); |
|
| 211 | 210 | } |
| 212 | 211 | |
| 213 | 212 | |
@@ -165,10 +165,10 @@ |
||
| 165 | 165 | |
| 166 | 166 | |
| 167 | 167 | /** |
| 168 | - * @param string $cacheKey |
|
| 169 | - * @param string $namespace |
|
| 170 | - * @return bool |
|
| 171 | - */ |
|
| 168 | + * @param string $cacheKey |
|
| 169 | + * @param string $namespace |
|
| 170 | + * @return bool |
|
| 171 | + */ |
|
| 172 | 172 | public function hasCache(string $cacheKey, string $namespace = '') |
| 173 | 173 | { |
| 174 | 174 | $cacheData = $this->getCache($cacheKey, $namespace); |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | { |
| 117 | 117 | $renewedCache = $this->cacheStore->renewCache($cacheKey, $ttl, $namespace); |
| 118 | 118 | |
| 119 | - if($renewedCache) { |
|
| 119 | + if ($renewedCache) { |
|
| 120 | 120 | $this->setMessage($this->cacheStore->getMessage(), $this->cacheStore->isSuccess()); |
| 121 | 121 | return true; |
| 122 | 122 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | * @param string $namespace |
| 104 | 104 | * @return bool |
| 105 | 105 | */ |
| 106 | - public function renew(string $cacheKey, int|string $ttl, string $namespace = '') |
|
| 106 | + public function renew(string $cacheKey, int | string $ttl, string $namespace = '') |
|
| 107 | 107 | { |
| 108 | 108 | $currentTime = date('Y-m-d H:i:s'); |
| 109 | 109 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | SET expirationTime = DATE_ADD(expirationTime, INTERVAL ? SECOND) |
| 124 | 124 | WHERE cacheKey = ? AND cacheNamespace = ? AND expirationTime > ?" |
| 125 | 125 | ); |
| 126 | - $stmt->bindValue(1, (int) $ttl, PDO::PARAM_INT); |
|
| 126 | + $stmt->bindValue(1, (int)$ttl, PDO::PARAM_INT); |
|
| 127 | 127 | $stmt->bindValue(2, $cacheKey); |
| 128 | 128 | $stmt->bindValue(3, $namespace); |
| 129 | 129 | $stmt->bindValue(4, $currentTime); |
@@ -44,10 +44,10 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | - * @param string $cacheKey |
|
| 48 | - * @param string $namespace |
|
| 49 | - * @return mixed |
|
| 50 | - */ |
|
| 47 | + * @param string $cacheKey |
|
| 48 | + * @param string $namespace |
|
| 49 | + * @return mixed |
|
| 50 | + */ |
|
| 51 | 51 | public function retrieve(string $cacheKey, string $namespace = '') |
| 52 | 52 | { |
| 53 | 53 | $driver = $this->connection->getAttribute(PDO::ATTR_DRIVER_NAME); |
@@ -101,11 +101,11 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
| 104 | - * @param string $cacheKey |
|
| 105 | - * @param int|string $ttl |
|
| 106 | - * @param string $namespace |
|
| 107 | - * @return bool |
|
| 108 | - */ |
|
| 104 | + * @param string $cacheKey |
|
| 105 | + * @param int|string $ttl |
|
| 106 | + * @param string $namespace |
|
| 107 | + * @return bool |
|
| 108 | + */ |
|
| 109 | 109 | public function renew(string $cacheKey, int|string $ttl, string $namespace = '') |
| 110 | 110 | { |
| 111 | 111 | $currentTime = date('Y-m-d H:i:s'); |
@@ -160,9 +160,9 @@ discard block |
||
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
| 163 | - * @param string $driver |
|
| 164 | - * @return string |
|
| 165 | - */ |
|
| 163 | + * @param string $driver |
|
| 164 | + * @return string |
|
| 165 | + */ |
|
| 166 | 166 | private function getCurrentDateTime(string $driver) |
| 167 | 167 | { |
| 168 | 168 | return ($driver === 'sqlite') ? "DATETIME('now', 'localtime')" : "NOW()"; |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | - * @param string $databaseDir |
|
| 40 | - * @return void |
|
| 41 | - */ |
|
| 39 | + * @param string $databaseDir |
|
| 40 | + * @return void |
|
| 41 | + */ |
|
| 42 | 42 | private static function createDatabaseDir(string $databaseDir) |
| 43 | 43 | { |
| 44 | 44 | if (!is_dir($databaseDir)) { |
@@ -47,9 +47,9 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | - * @param string $dbFile |
|
| 51 | - * @return void |
|
| 52 | - */ |
|
| 50 | + * @param string $dbFile |
|
| 51 | + * @return void |
|
| 52 | + */ |
|
| 53 | 53 | private static function createDatabaseFile(string $dbFile) |
| 54 | 54 | { |
| 55 | 55 | if (!file_exists($dbFile)) { |
@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | - * @param string $database |
|
| 62 | - * @return string |
|
| 63 | - */ |
|
| 61 | + * @param string $database |
|
| 62 | + * @return string |
|
| 63 | + */ |
|
| 64 | 64 | private static function checkExtension(string $database) |
| 65 | 65 | { |
| 66 | 66 | if (strpos($database, '.sqlite') === false) { |