Passed
Push — master ( 429320...4248bd )
by Chris
03:24
created

Text::resolveAttributes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
3
namespace WebTheory\Saveyour\Fields;
4
5
use WebTheory\Html\AbstractHtmlElement;
6
use WebTheory\Saveyour\Contracts\FormFieldInterface;
7
8
class Text extends AbstractInput implements FormFieldInterface
9
{
10
    /**
11
     *
12
     */
13
    protected $type = 'text';
14
15
    /**
16
     * @var string
17
     */
18
    protected $pattern;
19
20
    /**
21
     *
22
     */
23
    protected function resolveAttributes(): AbstractHtmlElement
24
    {
25
        return parent::resolveAttributes()
26
            ->addAttribute('pattern', $this->pattern);
0 ignored issues
show
Bug introduced by
'pattern' of type string is incompatible with the type array expected by parameter $attribute of WebTheory\Html\AbstractHtmlElement::addAttribute(). ( Ignorable by Annotation )

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

26
            ->addAttribute(/** @scrutinizer ignore-type */ 'pattern', $this->pattern);
Loading history...
27
    }
28
}
29