src/Storage/Drivers/ArrayStorage.php 1 location
|
@@ 30-39 (lines=10) @@
|
27 |
|
* @param \Closure $then |
28 |
|
* @return object|mixed |
29 |
|
*/ |
30 |
|
public function remember(Readable $readable, \Closure $then) |
31 |
|
{ |
32 |
|
$key = $readable->getHash(); |
33 |
|
|
34 |
|
if (! \array_key_exists($key, $this->storage)) { |
35 |
|
$this->storage[$key] = $then($readable); |
36 |
|
} |
37 |
|
|
38 |
|
return $this->storage[$key]; |
39 |
|
} |
40 |
|
} |
41 |
|
|
src/Storage/Drivers/EmulatingStorage.php 1 location
|
@@ 31-40 (lines=10) @@
|
28 |
|
* @return object|mixed |
29 |
|
* @throws \BadMethodCallException |
30 |
|
*/ |
31 |
|
public function remember(Readable $readable, \Closure $then) |
32 |
|
{ |
33 |
|
$key = $readable->getHash(); |
34 |
|
|
35 |
|
if (! \array_key_exists($key, $this->storage)) { |
36 |
|
$this->storage[$key] = $this->encode($then($readable)); |
37 |
|
} |
38 |
|
|
39 |
|
return $this->decode($this->storage[$key]); |
40 |
|
} |
41 |
|
|
42 |
|
/** |
43 |
|
* @param $data |