Skip to content

Commit cdc619e

Browse files
committed
feat(cache): set native type for $value param in CacheInterface::save() method
1 parent ff35267 commit cdc619e

File tree

7 files changed

+7
-25
lines changed

7 files changed

+7
-25
lines changed

system/Cache/CacheInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function get(string $key): mixed;
3636
*
3737
* @return bool Success or failure
3838
*/
39-
public function save(string $key, $value, int $ttl = 60): bool;
39+
public function save(string $key, mixed $value, int $ttl = 60): bool;
4040

4141
/**
4242
* Deletes a specific item from the cache store.

system/Cache/Handlers/DummyHandler.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ public function remember(string $key, int $ttl, Closure $callback): mixed
3636
return null;
3737
}
3838

39-
/**
40-
* @param mixed $value
41-
*/
42-
public function save(string $key, $value, int $ttl = 60): bool
39+
public function save(string $key, mixed $value, int $ttl = 60): bool
4340
{
4441
return true;
4542
}

system/Cache/Handlers/FileHandler.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,7 @@ public function get(string $key): mixed
8484
return is_array($data) ? $data['data'] : null;
8585
}
8686

87-
/**
88-
* @param mixed $value
89-
*/
90-
public function save(string $key, $value, int $ttl = 60): bool
87+
public function save(string $key, mixed $value, int $ttl = 60): bool
9188
{
9289
$key = static::validateKey($key, $this->prefix);
9390

system/Cache/Handlers/MemcachedHandler.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,7 @@ public function get(string $key): mixed
138138
return is_array($data) ? $data[0] : $data;
139139
}
140140

141-
/**
142-
* @param mixed $value
143-
*/
144-
public function save(string $key, $value, int $ttl = 60): bool
141+
public function save(string $key, mixed $value, int $ttl = 60): bool
145142
{
146143
$key = static::validateKey($key, $this->prefix);
147144

system/Cache/Handlers/PredisHandler.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,7 @@ public function get(string $key): mixed
101101
};
102102
}
103103

104-
/**
105-
* @param mixed $value
106-
*/
107-
public function save(string $key, $value, int $ttl = 60): bool
104+
public function save(string $key, mixed $value, int $ttl = 60): bool
108105
{
109106
$key = static::validateKey($key);
110107

system/Cache/Handlers/RedisHandler.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,7 @@ public function get(string $key): mixed
125125
};
126126
}
127127

128-
/**
129-
* @param mixed $value
130-
*/
131-
public function save(string $key, $value, int $ttl = 60): bool
128+
public function save(string $key, mixed $value, int $ttl = 60): bool
132129
{
133130
$key = static::validateKey($key, $this->prefix);
134131

system/Cache/Handlers/WincacheHandler.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ public function get(string $key): mixed
4747
return $success ? $data : null;
4848
}
4949

50-
/**
51-
* @param mixed $value
52-
*/
53-
public function save(string $key, $value, int $ttl = 60): bool
50+
public function save(string $key, mixed $value, int $ttl = 60): bool
5451
{
5552
$key = static::validateKey($key, $this->prefix);
5653

0 commit comments

Comments
 (0)