Skip to content

Commit f9210ef

Browse files
committed
Simplify logic in CacheManager now name is never null
1 parent 202ed0a commit f9210ef

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/Illuminate/Cache/CacheManager.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function __construct($app)
5757
*/
5858
public function store($name = null)
5959
{
60-
$name = $name ?: $this->getDefaultDriver();
60+
$name = $name ?? $this->getDefaultDriver();
6161

6262
return $this->stores[$name] ??= $this->resolve($name);
6363
}
@@ -81,7 +81,7 @@ public function driver($driver = null)
8181
*/
8282
public function memo($driver = null)
8383
{
84-
$driver = $driver ?: $this->getDefaultDriver();
84+
$driver = $driver ?? $this->getDefaultDriver();
8585

8686
$bindingKey = "cache.__memoized:{$driver}";
8787

@@ -430,11 +430,9 @@ protected function getPrefix(array $config)
430430
*/
431431
protected function getConfig($name)
432432
{
433-
if (! is_null($name) && $name !== 'null') {
434-
return $this->app['config']["cache.stores.{$name}"];
435-
}
436-
437-
return ['driver' => 'null'];
433+
return $name !== 'null'
434+
? $this->app['config']["cache.stores.{$name}"]
435+
: ['driver' => 'null'];
438436
}
439437

440438
/**

0 commit comments

Comments
 (0)