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

StatDefaults   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
eloc 21
c 1
b 0
f 1
dl 0
loc 50
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A defaults() 0 9 1
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Defaults;
4
5
class StatDefaults 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
        'ID' => 'int',
13
        'rating_id' => 'int',
14
    ];
15
16
    /**
17
     * The values that should be guarded.
18
     *
19
     * @var string[]
20
     */
21
    public array $guarded = [
22
        'ID',
23
    ];
24
25
    /**
26
     * The keys that should be mapped to other keys.
27
     * Keys are mapped before the values are normalized and sanitized.
28
     * Note: Mapped keys should not be included in the defaults!
29
     */
30
    public array $mapped = [
31
        'continentCode' => 'continent',
32
        'countryCode' => 'country',
33
    ];
34
35
    /**
36
     * The values that should be sanitized.
37
     * This is done after $casts and before $enums.
38
     */
39
    public array $sanitize = [
40
        'city' => 'text',
41
        'continent' => 'text',
42
        'country' => 'text',
43
        'region' => 'text',
44
    ];
45
46
    protected function defaults(): array
47
    {
48
        return [
49
            'city' => '',
50
            'continent' => '',
51
            'country' => '',
52
            'ID' => 0,
53
            'rating_id' => 0,
54
            'region' => '',
55
        ];
56
    }
57
}
58