@@ -32,7 +32,7 @@ public function __construct($prefix = 'cache', $path = null, $logger = null)
3232 * @return mixed Description
3333 * @throws \Psr\SimpleCache\InvalidArgumentException
3434 */
35- public function get ($ key , $ default = null )
35+ public function get (string $ key , mixed $ default = null ): mixed
3636 {
3737 // Check if file is Locked
3838 $ fileKey = $ this ->fixKey ($ key );
@@ -78,7 +78,7 @@ public function get($key, $default = null)
7878 *
7979 * MUST be thrown if the $key string is not a legal value.
8080 */
81- public function set ($ key , $ value , $ ttl = null )
81+ public function set (string $ key , mixed $ value , DateInterval | int | null $ ttl = null ): bool
8282 {
8383 $ fileKey = $ this ->fixKey ($ key );
8484
@@ -119,7 +119,7 @@ public function set($key, $value, $ttl = null)
119119 * @return bool
120120 * @throws \Psr\SimpleCache\InvalidArgumentException
121121 */
122- public function delete ($ key )
122+ public function delete (string $ key ): bool
123123 {
124124 $ this ->set ($ key , null );
125125 return true ;
@@ -129,7 +129,7 @@ public function delete($key)
129129 * Lock resource before set it.
130130 * @param string $key
131131 */
132- public function lock ($ key )
132+ public function lock (string $ key ): void
133133 {
134134 $ this ->logger ->info ("[Filesystem cache] Lock ' $ key' " );
135135
@@ -146,7 +146,7 @@ public function lock($key)
146146 * UnLock resource after set it.
147147 * @param string $key
148148 */
149- public function unlock ($ key )
149+ public function unlock ($ key ): void
150150 {
151151
152152 $ this ->logger ->info ("[Filesystem cache] Unlock ' $ key' " );
@@ -158,7 +158,7 @@ public function unlock($key)
158158 }
159159 }
160160
161- public function isAvailable ()
161+ public function isAvailable (): bool
162162 {
163163 return is_writable (dirname ($ this ->fixKey ('test ' )));
164164 }
@@ -178,7 +178,7 @@ protected function fixKey($key)
178178 *
179179 * @return bool True on success and false on failure.
180180 */
181- public function clear ()
181+ public function clear (): bool
182182 {
183183 $ patternKey = $ this ->fixKey ('* ' );
184184 $ list = glob ($ patternKey );
@@ -200,7 +200,7 @@ public function clear()
200200 * @throws \Psr\SimpleCache\InvalidArgumentException
201201 * MUST be thrown if the $key string is not a legal value.
202202 */
203- public function has ($ key )
203+ public function has (string $ key ): bool
204204 {
205205 $ fileKey = $ this ->fixKey ($ key );
206206 if (file_exists ($ fileKey )) {
0 commit comments