@@ -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); |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Dotenv\Dotenv; |
| 4 | 4 | |
| 5 | - if(file_exists(__DIR__ . "./../../.env")){ |
|
| 5 | + if (file_exists(__DIR__ . "./../../.env")) { |
|
| 6 | 6 | $dotenv = Dotenv::createImmutable(__DIR__ . "./../../"); |
| 7 | 7 | $dotenv->load(); |
| 8 | 8 | } |
@@ -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 | } |
@@ -98,11 +98,11 @@ |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | - * @param string $cacheKey |
|
| 102 | - * @param int|string $ttl |
|
| 103 | - * @param string $namespace |
|
| 104 | - * @return bool |
|
| 105 | - */ |
|
| 101 | + * @param string $cacheKey |
|
| 102 | + * @param int|string $ttl |
|
| 103 | + * @param string $namespace |
|
| 104 | + * @return bool |
|
| 105 | + */ |
|
| 106 | 106 | public function renew(string $cacheKey, int|string $ttl, string $namespace = '') |
| 107 | 107 | { |
| 108 | 108 | $currentTime = date('Y-m-d H:i:s'); |
@@ -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); |