Test Failed
Push — develop ( c0d6f9...325b33 )
by Paul
08:37
created

BricksSiteReviews::render()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 9
rs 10
cc 2
nc 2
nop 0
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Integrations\Bricks;
4
5
use GeminiLabs\SiteReviews\Contracts\ShortcodeContract;
6
use GeminiLabs\SiteReviews\Shortcodes\SiteReviewsShortcode;
7
8
class BricksSiteReviews extends BricksElement
9
{
10
    public function render()
11
    {
12
        if (!$this->elShortcode->hasVisibleFields($this->settings)) {
13
            $this->render_element_placeholder([
14
                'title' => esc_html_x('You have hidden all of the fields.', 'admin-text', 'site-reviews'),
15
            ]);
16
            return;
17
        }
18
        parent::render();
19
    }
20
21
    public static function shortcode(): ShortcodeContract
22
    {
23
        return glsr(SiteReviewsShortcode::class);
24
    }
25
}
26