Text::resolveAttributes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace WebTheory\Saveyour\Field\Type;
4
5
use WebTheory\Saveyour\Contracts\Field\FormFieldInterface;
6
use WebTheory\Saveyour\Field\Type\Abstracts\AbstractInput;
7
8
class Text extends AbstractInput implements FormFieldInterface
9
{
10
    protected string $type = 'text';
11
12
    protected ?string $pattern = null;
13
14
    /**
15
     * @return $this
16
     */
17
    protected function resolveAttributes(): Text
18
    {
19
        parent::resolveAttributes()
20
            ->addAttribute('pattern', $this->pattern);
21
22
        return $this;
23
    }
24
}
25