Test Failed
Push — master ( 135f34...8b25c6 )
by Chris
33:49
created

Setting   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 6
eloc 10
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 19 6
1
<?php
2
3
namespace Leonidas\Library\System\Setting;
4
5
use Leonidas\Contracts\System\Setting\SettingHandlerInterface;
6
use Leonidas\Contracts\System\Setting\SettingInterface;
7
use Leonidas\Library\System\Setting\Traits\HasSettingDataTrait;
8
9
class Setting implements SettingInterface
10
{
11
    use HasSettingDataTrait;
12
13
    public function __construct(
14
        string $optionGroup,
15
        string $optionName,
16
        ?string $type = null,
17
        ?string $description = null,
18
        ?SettingHandlerInterface $handler = null,
19
        $restSchema = null,
20
        $defaultValue = null,
21
        ?array $extraArgs = null
22
    ) {
23
        $this->optionGroup = $optionGroup;
24
        $this->optionName = $optionName;
25
        $this->handler = $handler;
26
27
        $type && $this->type = $type;
28
        $description && $this->description = $description;
29
        $restSchema && $this->restSchema = $restSchema;
30
        $defaultValue && $this->defaultValue = $defaultValue;
31
        $extraArgs && $this->extraArgs = $extraArgs;
32
    }
33
}
34