Skip to content

Commit 00dfdf4

Browse files
committed
formatting
1 parent 8469220 commit 00dfdf4

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

src/Illuminate/Cache/DatabaseStore.php

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ public function many(array $keys)
117117

118118
$results = array_fill_keys($keys, null);
119119

120+
// First we will retrieve all of the items from the cache using their keys and
121+
// the prefix value. Then we will need to iterate through each of the items
122+
// and convert them to an object when they are currently in array format.
120123
$values = $this->table()
121124
->whereIn('key', array_map(function ($key) {
122125
return $this->prefix.$key;
@@ -170,6 +173,7 @@ public function put($key, $value, $seconds)
170173
public function putMany(array $values, $seconds)
171174
{
172175
$serializedValues = [];
176+
173177
$expiration = $this->getTime() + $seconds;
174178

175179
foreach ($values as $key => $value) {
@@ -369,19 +373,10 @@ public function forgetIfExpired($key)
369373
/**
370374
* Remove all items from the cache.
371375
*
376+
* @param array $keys
372377
* @return bool
373378
*/
374-
public function flush()
375-
{
376-
$this->table()->delete();
377-
378-
return true;
379-
}
380-
381-
/**
382-
* Remove all items from the cache.
383-
*/
384-
protected function forgetMany(array $keys): bool
379+
protected function forgetMany(array $keys)
385380
{
386381
$this->table()->whereIn('key', array_map(function ($key) {
387382
return $this->prefix.$key;
@@ -392,8 +387,12 @@ protected function forgetMany(array $keys): bool
392387

393388
/**
394389
* Remove all expired items from the given set from the cache.
390+
*
391+
* @param array $keys
392+
* @param bool $prefixed
393+
* @return bool
395394
*/
396-
protected function forgetManyIfExpired(array $keys, bool $prefixed = false): bool
395+
protected function forgetManyIfExpired(array $keys, bool $prefixed = false)
397396
{
398397
$this->table()
399398
->whereIn('key', $prefixed ? $keys : array_map(function ($key) {
@@ -405,6 +404,18 @@ protected function forgetManyIfExpired(array $keys, bool $prefixed = false): boo
405404
return true;
406405
}
407406

407+
/**
408+
* Remove all items from the cache.
409+
*
410+
* @return bool
411+
*/
412+
public function flush()
413+
{
414+
$this->table()->delete();
415+
416+
return true;
417+
}
418+
408419
/**
409420
* Get a query builder for the cache table.
410421
*

0 commit comments

Comments
 (0)