RedisSettingsManager   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 4
c 1
b 0
f 0
dl 0
loc 9
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A apply() 0 7 1
1
<?php
2
3
namespace Glorand\Model\Settings\Managers;
4
5
use Glorand\Model\Settings\Contracts\SettingsManagerContract;
6
use Illuminate\Support\Facades\Redis;
7
8
/**
9
 * Class FieldSettingsManager
10
 * @package Glorand\Model\Settings\Managers
11
 * @property \Illuminate\Database\Eloquent\Model|\Glorand\Model\Settings\Traits\HasSettingsRedis $model
12
 */
13
class RedisSettingsManager extends AbstractSettingsManager
14
{
15 42
    public function apply(array $settings = []): SettingsManagerContract
16
    {
17 42
        $this->validate($settings);
18
19 42
        Redis::set($this->model->cacheKey(), json_encode($settings));
20
21
        return $this;
22
    }
23
}
24