Skip to content

Commit 53a6e5e

Browse files
committed
Revert "Cache: used typehint 'callable' (suppresses lazyloading of classes)"
Partially reverts commit ff40784.
1 parent d566329 commit 53a6e5e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Caching/Cache.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ public function derive($namespace)
8282
/**
8383
* Reads the specified item from the cache or generate it.
8484
* @param mixed $key
85+
* @param callable $fallback
8586
* @return mixed
8687
*/
87-
public function load($key, callable $fallback = null)
88+
public function load($key, $fallback = null)
8889
{
8990
$data = $this->storage->read($this->generateKey($key));
9091
if ($data === null && $fallback) {
@@ -98,9 +99,10 @@ public function load($key, callable $fallback = null)
9899

99100
/**
100101
* Reads multiple items from the cache.
102+
* @param callable $fallback
101103
* @return array
102104
*/
103-
public function bulkLoad(array $keys, callable $fallback = null)
105+
public function bulkLoad(array $keys, $fallback = null)
104106
{
105107
if (count($keys) === 0) {
106108
return [];
@@ -268,9 +270,10 @@ public function clean(array $conditions = null)
268270

269271
/**
270272
* Caches results of function/method calls.
273+
* @param callable $function
271274
* @return mixed
272275
*/
273-
public function call(callable $function)
276+
public function call($function)
274277
{
275278
$key = func_get_args();
276279
if (is_array($function) && is_object($function[0])) {
@@ -284,9 +287,10 @@ public function call(callable $function)
284287

285288
/**
286289
* Caches results of function/method calls.
290+
* @param callable $function
287291
* @return \Closure
288292
*/
289-
public function wrap(callable $function, array $dependencies = null)
293+
public function wrap($function, array $dependencies = null)
290294
{
291295
return function () use ($function, $dependencies) {
292296
$key = [$function, func_get_args()];

0 commit comments

Comments
 (0)