Test Failed
Push — develop ( 55c79d...550055 )
by Paul
09:38
created

QueryAjaxDefaults::defaults()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Integrations\Elementor\Defaults;
4
5
use GeminiLabs\SiteReviews\Defaults\DefaultsAbstract;
6
7
class QueryAjaxDefaults extends DefaultsAbstract
8
{
9
    /**
10
     * The values that should be cast before sanitization is run.
11
     * This is done before $sanitize and $enums.
12
     */
13
    public array $casts = [
14
        'post_id' => 'int',
15
    ];
16
17
    /**
18
     * The keys that should be mapped to other keys.
19
     * Keys are mapped before the values are normalized and sanitized.
20
     * Note: Mapped keys should not be included in the defaults!
21
     */
22
    public array $mapped = [
23
        'editor_post_id' => 'post_id',
24
        'id' => 'include',
25
    ];
26
27
    /**
28
     * The values that should be sanitized.
29
     * This is done after $casts and before $enums.
30
     */
31
    public array $sanitize = [
32
        'include' => 'text',
33
        'option' => 'name',
34
        'search' => 'text',
35
        'shortcode' => 'name',
36
    ];
37
38
    protected function defaults(): array
39
    {
40
        return [
41
            'include' => '',
42
            'option' => '',
43
            'post_id' => '',
44
            'search' => '',
45
            'shortcode' => '',
46
        ];
47
    }
48
}
49