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

QueryAjaxDefaults   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A defaults() 0 8 1
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