Passed
Push — develop ( 39ad60...0ca1de )
by Paul
14:09
created

BricksSiteReviewsForm::designConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 12
ccs 0
cts 11
cp 0
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Integrations\Bricks\Elements;
4
5
use GeminiLabs\SiteReviews\Integrations\Bricks\BricksElement;
6
use GeminiLabs\SiteReviews\Shortcodes\SiteReviewsFormShortcode;
7
8
class BricksSiteReviewsForm extends BricksElement
9
{
10
    public function designConfig(): array
11
    {
12
        return [
13
            'style_align' => [
14
                'exclude' => ['stretch', 'auto'],
15
                'group' => 'design',
16
                'inline' => true,
17
                'label' => esc_html__('Align', 'bricks'),
18
                'rerender' => true,
19
                'tab' => 'style',
20
                'themeStyle' => true,
21
                'type' => 'align-items',
22
            ],
23
        ];
24
    }
25
26
    public function render()
27
    {
28
        if (!$this->shortcodeInstance()->hasVisibleFields($this->settings)) {
29
            $this->render_element_placeholder([
30
                'title' => esc_html_x('You have hidden all of the fields.', 'admin-text', 'site-reviews'),
31
            ]);
32
            return;
33
        }
34
        parent::render();
35
    }
36
37
    public static function shortcodeClass(): string
38
    {
39
        return SiteReviewsFormShortcode::class;
40
    }
41
}
42