Passed
Push — master ( 4bf842...d9eb19 )
by Gombos
03:18
created

HasSettings   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDefaultSettings() 0 7 2
1
<?php
2
3
namespace Glorand\Model\Settings\Traits;
4
5
use Illuminate\Support\Arr;
6
7
trait HasSettings
8
{
9 27
    public function getDefaultSettings(): array
10
    {
11 27
        if (property_exists($this, 'defaultSettings')) {
12 26
            return Arr::wrap($this->defaultSettings);
13
        }
14
15 1
        return [];
16
    }
17
18
    /**
19
     * @return array
20
     */
21
    abstract public function getSettingsValue(): array;
22
}
23