Test Failed
Push — develop ( 33b521...cdbd76 )
by Paul
10:16 queued 21s
created

FlagDefaults::defaults()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Defaults;
4
5
class FlagDefaults extends DefaultsAbstract
6
{
7
    /**
8
     * The values that should be cast before sanitization is run.
9
     * This is done before $sanitize and $enums.
10
     */
11
    public array $casts = [
12
        'data-border' => 'bool',
13
        'data-radius' => 'bool',
14
    ];
15
16
    /**
17
     * The values that should be constrained after sanitization is run.
18
     * This is done after $casts and $sanitize.
19
     */
20
    public array $enums = [
21
        'data-gradient' => [
22
            '', 'circular', 'diagonal', 'linear',
23
        ],
24
        'data-shape' => [
25
            '', 'circle', 'rectangle', 'square',
26
        ],
27
    ];
28
29
    /**
30
     * The values that should be sanitized.
31
     * This is done after $casts and before $enums.
32
     */
33
    public array $sanitize = [
34
        'data-gradient' => 'attr',
35
        'data-shape' => 'attr',
36
    ];
37
38
    protected function defaults(): array
39
    {
40
        return [
41
            'data-border' => true,
42
            'data-gradient' => 'linear',
43
            'data-radius' => true,
44
            'data-shape' => '',
45
        ];
46
    }
47
}
48