mirror of
https://github.com/wearepixel/laravel-cart.git
synced 2026-11-14 13:51:44 +00:00
fix: null-safe json_decode in RedisDriver; add getSessionModel test to MultiDriverTest
This commit is contained in:
@@ -57,7 +57,7 @@ public function getItems(): array
|
||||
{
|
||||
$data = $this->redis->connection($this->connection)->get($this->itemsKey());
|
||||
|
||||
return $data ? json_decode($data, true) : [];
|
||||
return $data ? (json_decode($data, true) ?? []) : [];
|
||||
}
|
||||
|
||||
public function putItems(array $items): void
|
||||
@@ -73,7 +73,7 @@ public function getConditions(): array
|
||||
{
|
||||
$data = $this->redis->connection($this->connection)->get($this->conditionsKey());
|
||||
|
||||
return $data ? json_decode($data, true) : [];
|
||||
return $data ? (json_decode($data, true) ?? []) : [];
|
||||
}
|
||||
|
||||
public function putConditions(array $conditions): void
|
||||
|
||||
Reference in New Issue
Block a user