Test Failed
Push — develop ( db5b9c...b55dd4 )
by Paul
17:52
created

SiteReviewWidget::widgetConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 16
c 0
b 0
f 0
dl 0
loc 21
ccs 0
cts 17
cp 0
rs 9.7333
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Widgets;
4
5
use GeminiLabs\SiteReviews\Contracts\ShortcodeContract;
6
use GeminiLabs\SiteReviews\Shortcodes\SiteReviewShortcode;
7
8
class SiteReviewWidget extends Widget
9
{
10
    protected function wConfig(): array
11
    {
12
        return [
13
            'post_id' => [
14
                'description' => esc_html_x('Enter the Post ID of the review you want to display.', 'admin-text', 'site-reviews'),
15
                'label' => esc_html_x('Review Post ID', 'admin-text', 'site-reviews'),
16
                'type' => 'text',
17
            ],
18
            'hide' => [
19
                'options' => $this->shortcode->options('hide'),
20
                'type' => 'checkbox',
21
            ],
22
            'id' => [
23
                'description' => esc_html_x('This should be a unique value.', 'admin-text', 'site-reviews'),
24
                'label' => esc_html_x('Custom ID', 'admin-text', 'site-reviews'),
25
                'type' => 'text',
26
            ],
27
            'class' => [
28
                'description' => esc_html_x('Separate multiple classes with spaces.', 'admin-text', 'site-reviews'),
29
                'label' => esc_html_x('Additional CSS classes', 'admin-text', 'site-reviews'),
30
                'type' => 'text',
31
            ],
32
        ];
33
    }
34
35
    protected function wShortcode(): ShortcodeContract
36
    {
37
        return glsr(SiteReviewShortcode::class);
1 ignored issue
show
Bug Best Practice introduced by
The expression return glsr(GeminiLabs\S...ReviewShortcode::class) could return the type callable which is incompatible with the type-hinted return GeminiLabs\SiteReviews\Contracts\ShortcodeContract. Consider adding an additional type-check to rule them out.
Loading history...
38
    }
39
}
40