Skip to content

Commit 5828d6c

Browse files
driesvintstaylorotwell
authored andcommitted
[9.x] Add support for psr/simple-cache v2 and v3 (#40249)
* Add support for psr/simple-cache v2 and v3 * wip * wip
1 parent 6f83de8 commit 5828d6c

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"nesbot/carbon": "^2.53.1",
2929
"psr/container": "^1.1.1|^2.0.1",
3030
"psr/log": "^1.0|^2.0|^3.0",
31-
"psr/simple-cache": "^1.0",
31+
"psr/simple-cache": "^1.0|^2.0|^3.0",
3232
"ramsey/uuid": "^4.2.2",
3333
"symfony/console": "^6.0",
3434
"symfony/error-handler": "^6.0",
@@ -96,7 +96,7 @@
9696
},
9797
"provide": {
9898
"psr/container-implementation": "1.0",
99-
"psr/simple-cache-implementation": "1.0"
99+
"psr/simple-cache-implementation": "1.0|2.0|3.0"
100100
},
101101
"conflict": {
102102
"tightenco/collect": "<5.5.33"

src/Illuminate/Cache/Repository.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function __construct(Store $store)
6565
* @param string $key
6666
* @return bool
6767
*/
68-
public function has($key)
68+
public function has($key): bool
6969
{
7070
return ! is_null($this->get($key));
7171
}
@@ -88,7 +88,7 @@ public function missing($key)
8888
* @param mixed $default
8989
* @return mixed
9090
*/
91-
public function get($key, $default = null)
91+
public function get($key, $default = null): mixed
9292
{
9393
if (is_array($key)) {
9494
return $this->many($key);
@@ -134,7 +134,7 @@ public function many(array $keys)
134134
*
135135
* @return iterable
136136
*/
137-
public function getMultiple($keys, $default = null)
137+
public function getMultiple($keys, $default = null): iterable
138138
{
139139
$defaults = [];
140140

@@ -224,7 +224,7 @@ public function put($key, $value, $ttl = null)
224224
*
225225
* @return bool
226226
*/
227-
public function set($key, $value, $ttl = null)
227+
public function set($key, $value, $ttl = null): bool
228228
{
229229
return $this->put($key, $value, $ttl);
230230
}
@@ -283,7 +283,7 @@ protected function putManyForever(array $values)
283283
*
284284
* @return bool
285285
*/
286-
public function setMultiple($values, $ttl = null)
286+
public function setMultiple($values, $ttl = null): bool
287287
{
288288
return $this->putMany(is_array($values) ? $values : iterator_to_array($values), $ttl);
289289
}
@@ -448,7 +448,7 @@ public function forget($key)
448448
*
449449
* @return bool
450450
*/
451-
public function delete($key)
451+
public function delete($key): bool
452452
{
453453
return $this->forget($key);
454454
}
@@ -458,7 +458,7 @@ public function delete($key)
458458
*
459459
* @return bool
460460
*/
461-
public function deleteMultiple($keys)
461+
public function deleteMultiple($keys): bool
462462
{
463463
$result = true;
464464

@@ -476,7 +476,7 @@ public function deleteMultiple($keys)
476476
*
477477
* @return bool
478478
*/
479-
public function clear()
479+
public function clear(): bool
480480
{
481481
return $this->store->flush();
482482
}

src/Illuminate/Cache/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"illuminate/support": "^9.0"
2222
},
2323
"provide": {
24-
"psr/simple-cache-implementation": "1.0"
24+
"psr/simple-cache-implementation": "1.0|2.0|3.0"
2525
},
2626
"autoload": {
2727
"psr-4": {

src/Illuminate/Contracts/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"require": {
1717
"php": "^8.0.2",
1818
"psr/container": "^1.1.1|^2.0.1",
19-
"psr/simple-cache": "^1.0"
19+
"psr/simple-cache": "^1.0|^2.0|^3.0"
2020
},
2121
"autoload": {
2222
"psr-4": {

0 commit comments

Comments
 (0)