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

HasSettings::getDefaultSettings()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

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