Passed
Push — develop ( 6f0b3c...59c8d7 )
by Paul
14:05
created

ControlDefaults::finalize()   A

Complexity

Conditions 5
Paths 4

Size

Total Lines 21
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 30

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
dl 0
loc 21
ccs 0
cts 18
cp 0
rs 9.4555
c 1
b 0
f 0
cc 5
nc 4
nop 1
crap 30
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Integrations\WPBakery\Defaults;
4
5
use GeminiLabs\SiteReviews\Defaults\DefaultsAbstract;
6
7
class ControlDefaults extends DefaultsAbstract
8
{
9
    /**
10
     * The values that should be constrained after sanitization is run.
11
     * This is done after $casts and $sanitize.
12
     */
13
    public array $enums = [
14
        'group' => [
15
            'advanced', 'design', 'general',
16
        ],
17
    ];
18
19
    /**
20
     * The keys that should be mapped to other keys.
21
     * Keys are mapped before the values are normalized and sanitized.
22
     * Note: Mapped keys should not be included in the defaults!
23
     */
24
    public array $mapped = [
25
        'default' => 'std',
26
        'label' => 'heading',
27
        'name' => 'param_name',
28
    ];
29
30
    protected function defaults(): array
31
    {
32
        return [
33
            'group' => 'general',
34
            'heading' => '',
35
            'param_name' => '',
36
            'std' => '',
37
            'type' => 'textfield',
38
        ];
39
    }
40
}
41