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

RedisSettingsManager::set()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
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