Skip to content

Commit 52bc6b1

Browse files
author
Yitz Willroth
committed
:clean: remove inadvertent inclusions
1 parent fcc3bdf commit 52bc6b1

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

src/Illuminate/Cache/FileStore.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ protected function getPayload($key)
312312
}
313313

314314
$expire = substr($contents, 0, 10);
315-
} catch (Exception $e) {
315+
} catch (Exception) {
316316
return $this->emptyPayload();
317317
}
318318

@@ -328,7 +328,6 @@ protected function getPayload($key)
328328
try {
329329
$data = unserialize(substr($contents, 10));
330330
} catch (Exception) {
331-
332331
$this->forget($key);
333332

334333
return $this->emptyPayload();

src/Illuminate/Cache/RedisStore.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ protected function serialize($value)
466466
* Determine if the given value should be stored as plain value.
467467
*
468468
* @param mixed $value
469+
* @return bool
469470
*/
470471
protected function shouldBeStoredWithoutSerialization($value): bool
471472
{

src/Illuminate/Cache/Repository.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ public function put($key, $value, $ttl = null)
250250

251251
/**
252252
* {@inheritdoc}
253+
*
254+
* @return bool
253255
*/
254256
public function set($key, $value, $ttl = null): bool
255257
{
@@ -259,6 +261,7 @@ public function set($key, $value, $ttl = null): bool
259261
/**
260262
* Store multiple items in the cache for a given number of seconds.
261263
*
264+
* @param array $values
262265
* @param \DateTimeInterface|\DateInterval|int|null $ttl
263266
* @return bool
264267
*/
@@ -292,6 +295,7 @@ public function putMany(array $values, $ttl = null)
292295
/**
293296
* Store multiple items in the cache indefinitely.
294297
*
298+
* @param array $values
295299
* @return bool
296300
*/
297301
protected function putManyForever(array $values)
@@ -527,7 +531,7 @@ public function flexible($key, $ttl, $callback, $lock = null, $alwaysDefer = fal
527531
public function touch(string $key, \DateTimeInterface|\DateInterval|int|null $ttl = null): bool
528532
{
529533
$value = $this->get($key);
530-
534+
531535
if (is_null($value)) {
532536
return false;
533537
}
@@ -558,6 +562,8 @@ public function forget($key)
558562

559563
/**
560564
* {@inheritdoc}
565+
*
566+
* @return bool
561567
*/
562568
public function delete($key): bool
563569
{
@@ -566,6 +572,8 @@ public function delete($key): bool
566572

567573
/**
568574
* {@inheritdoc}
575+
*
576+
* @return bool
569577
*/
570578
public function deleteMultiple($keys): bool
571579
{
@@ -582,6 +590,8 @@ public function deleteMultiple($keys): bool
582590

583591
/**
584592
* {@inheritdoc}
593+
*
594+
* @return bool
585595
*/
586596
public function clear(): bool
587597
{
@@ -743,6 +753,7 @@ public function getEventDispatcher()
743753
/**
744754
* Set the event dispatcher instance.
745755
*
756+
* @param \Illuminate\Contracts\Events\Dispatcher $events
746757
* @return void
747758
*/
748759
public function setEventDispatcher(Dispatcher $events)
@@ -754,6 +765,7 @@ public function setEventDispatcher(Dispatcher $events)
754765
* Determine if a cached value exists.
755766
*
756767
* @param string $key
768+
* @return bool
757769
*/
758770
public function offsetExists($key): bool
759771
{
@@ -764,6 +776,7 @@ public function offsetExists($key): bool
764776
* Retrieve an item from the cache by key.
765777
*
766778
* @param string $key
779+
* @return mixed
767780
*/
768781
public function offsetGet($key): mixed
769782
{
@@ -775,6 +788,7 @@ public function offsetGet($key): mixed
775788
*
776789
* @param string $key
777790
* @param mixed $value
791+
* @return void
778792
*/
779793
public function offsetSet($key, $value): void
780794
{
@@ -785,6 +799,7 @@ public function offsetSet($key, $value): void
785799
* Remove an item from the cache.
786800
*
787801
* @param string $key
802+
* @return void
788803
*/
789804
public function offsetUnset($key): void
790805
{

tests/Cache/CacheApcStoreTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,4 @@ public function testFlushesCached()
146146
$result = $store->flush();
147147
$this->assertTrue($result);
148148
}
149-
150-
151149
}

tests/Cache/CacheRedisStoreTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,10 @@ public function testTouchMethodProperlyCallsRedis(): void
136136

137137
public function testForgetMethodProperlyCallsRedis()
138138
{
139-
$key = 'key';
140-
141139
$redis = $this->getRedis();
142-
143140
$redis->getRedis()->shouldReceive('connection')->once()->with('default')->andReturn($redis->getRedis());
144-
$redis->getRedis()->shouldReceive('del')->once()->with("prefix:$key");
145-
146-
$redis->forget($key);
141+
$redis->getRedis()->shouldReceive('del')->once()->with('prefix:foo');
142+
$redis->forget('foo');
147143
}
148144

149145
public function testFlushesCached()

0 commit comments

Comments
 (0)