Passed
Push — master ( b54e8f...ab9cd5 )
by Gombos
03:13
created

RedisSettingsManager::delete()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 13
ccs 7
cts 7
cp 1
rs 10
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Glorand\Model\Settings\Managers;
4
5
use Glorand\Model\Settings\Contracts\SettingsManagerContract;
6
use Illuminate\Support\Arr;
7
use Illuminate\Support\Facades\Redis;
8
9
/**
10
 * Class FieldSettingsManager
11
 * @package Glorand\Model\Settings\Managers
12
 * @property \Illuminate\Database\Eloquent\Model|\Glorand\Model\Settings\Traits\HasSettingsRedis $model
13
 */
14
class RedisSettingsManager extends AbstractSettingsManager
15
{
16 33
    public function apply(array $settings = []): SettingsManagerContract
17
    {
18 33
        Redis::set($this->model->cacheKey(), json_encode($settings));
19
20 33
        return $this;
21
    }
22
}
23