Passed
Push — develop ( 391f8f...187ad6 )
by Paul
13:53
created

SiteReviewTinymce::shortcode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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 8
    public function fields(): array
11
    {
12 8
        return [
13 8
            [
14 8
                'label' => esc_attr_x('Review Post ID', 'admin-text', 'site-reviews'),
15 8
                'name' => 'post_id',
16 8
                'tooltip' => esc_attr_x('Enter the Post ID of the review to display.', 'admin-text', 'site-reviews'),
17 8
                'type' => 'textbox',
18 8
            ],
19 8
            [
20 8
                'columns' => 2,
21 8
                'items' => $this->hideOptions(),
22 8
                'label' => esc_attr_x('Hide', 'admin-text', 'site-reviews'),
23 8
                'layout' => 'grid',
24 8
                'spacing' => 5,
25 8
                'type' => 'container',
26 8
            ],
27 8
            [
28 8
                'label' => esc_html_x('Custom ID', 'admin-text', 'site-reviews'),
29 8
                'name' => 'id',
30 8
                'tooltip' => esc_html_x('This should be a unique value.', 'admin-text', 'site-reviews'),
31 8
                'type' => 'textbox',
32 8
            ],
33 8
            [
34 8
                'label' => esc_html_x('Additional CSS classes', 'admin-text', 'site-reviews'),
35 8
                'name' => 'class',
36 8
                'tooltip' => esc_html_x('Separate multiple classes with spaces.', 'admin-text', 'site-reviews'),
37 8
                'type' => 'textbox',
38 8
            ],
39 8
        ];
40
    }
41
42 8
    public function shortcode(): ShortcodeContract
43
    {
44 8
        return glsr(SiteReviewShortcode::class);
45
    }
46
}
47