Test Failed
Push — master ( 2c2c87...ed1c51 )
by Chris
25:05 queued 37s
created

HasSettingDataTrait   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
eloc 17
c 1
b 0
f 0
dl 0
loc 59
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getExtraArgs() 0 3 1
A getDescription() 0 3 1
A getType() 0 3 1
A getOptionName() 0 3 1
A getRestSchema() 0 3 1
A getHandler() 0 3 1
A getOptionGroup() 0 3 1
A getDefaultValue() 0 3 1
1
<?php
2
3
namespace Leonidas\Library\Admin\Setting\Traits;
4
5
use Leonidas\Contracts\Admin\Setting\SettingHandlerInterface;
6
7
trait HasSettingDataTrait
8
{
9
    protected string $optionGroup;
10
11
    protected string $optionName;
12
13
    protected ?string $type = 'string';
14
15
    protected ?string $description;
16
17
    protected ?SettingHandlerInterface $handler = null;
18
19
    protected mixed $defaultValue;
20
21
    /**
22
     * @var bool|array
23
     */
24
    protected $restSchema;
25
26
    protected ?array $extraArgs = null;
27
28
    public function getOptionGroup(): string
29
    {
30
        return $this->optionGroup;
31
    }
32
33
    public function getOptionName(): string
34
    {
35
        return $this->optionName;
36
    }
37
38
    public function getType(): ?string
39
    {
40
        return $this->type;
41
    }
42
43
    public function getDescription(): ?string
44
    {
45
        return $this->description;
46
    }
47
48
    public function getHandler(): ?SettingHandlerInterface
49
    {
50
        return $this->handler;
51
    }
52
53
    public function getRestSchema()
54
    {
55
        return $this->restSchema;
56
    }
57
58
    public function getDefaultValue()
59
    {
60
        return $this->defaultValue;
61
    }
62
63
    public function getExtraArgs(): ?array
64
    {
65
        return $this->extraArgs;
66
    }
67
}
68