Passed
Push — develop ( c34e50...445d6d )
by Paul
06:42
created

SiteReviewTinymce   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 21
dl 0
loc 37
ccs 0
cts 31
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A shortcode() 0 3 1
A fields() 0 28 1
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Tinymce;
4
5
use GeminiLabs\SiteReviews\Contracts\ShortcodeContract;
6
use GeminiLabs\SiteReviews\Shortcodes\SiteReviewShortcode;
7
8
class SiteReviewTinymce extends TinymceGenerator
9
{
10
    public function fields(): array
11
    {
12
        return [
13
            [
14
                'label' => esc_attr_x('Review Post ID', 'admin-text', 'site-reviews'),
15
                'name' => 'post_id',
16
                'tooltip' => esc_attr_x('Enter the Post ID of the review to display.', 'admin-text', 'site-reviews'),
17
                'type' => 'textbox',
18
            ],
19
            [
20
                'columns' => 2,
21
                'items' => $this->hideOptions(),
22
                'label' => esc_attr_x('Hide', 'admin-text', 'site-reviews'),
23
                'layout' => 'grid',
24
                'spacing' => 5,
25
                'type' => 'container',
26
            ],
27
            [
28
                'label' => esc_html_x('Custom ID', 'admin-text', 'site-reviews'),
29
                'name' => 'id',
30
                'tooltip' => esc_html_x('This should be a unique value.', 'admin-text', 'site-reviews'),
31
                'type' => 'textbox',
32
            ],
33
            [
34
                'label' => esc_html_x('Additional CSS classes', 'admin-text', 'site-reviews'),
35
                'name' => 'class',
36
                'tooltip' => esc_html_x('Separate multiple classes with spaces.', 'admin-text', 'site-reviews'),
37
                'type' => 'textbox',
38
            ],
39
        ];
40
    }
41
42
    public function shortcode(): ShortcodeContract
43
    {
44
        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...
45
    }
46
}
47