Test Failed
Push — develop ( 1707fa...c6b569 )
by Paul
07:52
created

WidgetField::namePrefix()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 0
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Modules\Html;
4
5
use GeminiLabs\SiteReviews\Contracts\BuilderContract;
6
7
class WidgetField extends Field
8
{
9
    public function builder(): BuilderContract
10
    {
11
        return glsr(WidgetBuilder::class);
12
    }
13
14
    public function buildField(): string
15
    {
16
        if ($this->is_raw) { // only build the field element
17
            return $this->builder()->build($this->tag(), $this->toArray());
18
        }
19
        if ('number' === $this->original_type) {
20
            return $this->builder()->p([
0 ignored issues
show
Bug introduced by
The method p() does not exist on GeminiLabs\SiteReviews\Contracts\BuilderContract. Since it exists in all sub-types, consider adding an abstract or default implementation to GeminiLabs\SiteReviews\Contracts\BuilderContract. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
            return $this->builder()->/** @scrutinizer ignore-call */ p([
Loading history...
21
                'style' => 'display:flex;align-items:baseline;gap:5px;',
22
                'text' => $this->buildFieldElement().$this->buildFieldLabel(),
23
            ]);
24
        }
25
        return $this->builder()->p([
26
            'text' => $this->buildFieldLabel().$this->buildFieldElement(),
27
        ]);
28
    }
29
30
    public function location(): string
31
    {
32
        return 'widget';
33
    }
34
35
    public function namePrefix(): string
36
    {
37
        return '';
38
    }
39
}
40