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

Text   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 19
ccs 0
cts 4
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolveAttributes() 0 4 1
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