SiteReviewsFormTinymce::shortcode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
ccs 1
cts 1
cp 1
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\SiteReviewsFormShortcode;
7 8
8
class SiteReviewsFormTinymce extends TinymceGenerator
9 8
{
10 8
    public function fields(): array
11 8
    {
12 8
        return [
13 8
            [
14 8
                'label' => esc_html_x('Assign Pages', 'admin-text', 'site-reviews'),
15 8
                'name' => 'assigned_posts',
16 8
                'tooltip' => sprintf(esc_html_x('Automatically assign reviews to a Post ID. You may also enter %s to use the Post ID of the current page.', 'admin-text', 'site-reviews'), '"post_id"'),
17 8
                'type' => 'textbox',
18 8
            ],
19 8
            [
20 8
                'label' => esc_html_x('Assign Categories', 'admin-text', 'site-reviews'),
21 8
                'name' => 'assigned_terms',
22 8
                'tooltip' => esc_html_x('Automatically assign reviews to a category. You may enter a Term ID or slug.', 'admin-text', 'site-reviews'),
23 8
                'type' => 'textbox',
24 8
            ],
25 8
            [
26 8
                'label' => esc_html_x('Assign Users', 'admin-text', 'site-reviews'),
27 8
                'name' => 'assigned_users',
28 8
                'tooltip' => sprintf(esc_html_x('Automatically assign reviews to a User ID. You may also enter %s to use the ID of the logged-in user.', 'admin-text', 'site-reviews'), '"user_id"'),
29 8
                'type' => 'textbox',
30 8
            ],
31 8
            [
32 8
                'columns' => 2,
33 8
                'items' => $this->hideOptions(),
34 8
                'label' => esc_html_x('Hide', 'admin-text', 'site-reviews'),
35 8
                'layout' => 'grid',
36 8
                'spacing' => 5,
37 8
                'type' => 'container',
38 8
            ],
39 8
            [
40 8
                'label' => esc_html_x('Latest Reviews ID', 'admin-text', 'site-reviews'),
41 8
                'name' => 'reviews_id',
42 8
                'tooltip' => _x('Enter the Custom ID of a Latest Reviews shortcode where the review should be displayed after submission.', 'admin-text', 'site-reviews'),
43 8
                'type' => 'textbox',
44 8
            ],
45 8
            [
46 8
                'label' => esc_html_x('Rating Summary ID', 'admin-text', 'site-reviews'),
47 8
                'name' => 'summary_id',
48 8
                'tooltip' => _x('Enter the Custom ID of a Rating Summary shortcode where the rating values should be updated after submission.', 'admin-text', 'site-reviews'),
49 8
                'type' => 'textbox',
50 8
            ],
51 8
            [
52 8
                'label' => esc_html_x('Custom ID', 'admin-text', 'site-reviews'),
53 8
                'name' => 'id',
54 8
                'tooltip' => esc_html_x('This should be a unique value.', 'admin-text', 'site-reviews'),
55 8
                'type' => 'textbox',
56 8
            ],
57 8
            [
58 8
                'label' => esc_html_x('Additional CSS classes', 'admin-text', 'site-reviews'),
59 8
                'name' => 'class',
60 8
                'tooltip' => esc_html_x('Separate multiple classes with spaces.', 'admin-text', 'site-reviews'),
61 8
                'type' => 'textbox',
62
            ],
63
        ];
64 8
    }
65
66 8
    public function shortcode(): ShortcodeContract
67
    {
68
        return glsr(SiteReviewsFormShortcode::class);
0 ignored issues
show
Bug Best Practice introduced by
The expression return glsr(GeminiLabs\S...wsFormShortcode::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...
69
    }
70
}
71