Passed
Push — master ( 4c5faf...429320 )
by Chris
04:23
created

AbstractStandardFormControl::resolveAttributes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 8
ccs 0
cts 7
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
abstract class AbstractStandardFormControl extends AbstractFormField implements FormFieldInterface
9
{
10
    /**
11
     * {@inheritDoc}
12
     */
13
    protected function resolveAttributes(): AbstractHtmlElement
14
    {
15
        return parent::resolveAttributes()
16
            ->addAttribute('name', $this->name)
0 ignored issues
show
Bug introduced by
'name' 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

16
            ->addAttribute(/** @scrutinizer ignore-type */ 'name', $this->name)
Loading history...
17
            ->addAttribute('disabled', $this->disabled)
18
            ->addAttribute('readonly', $this->readonly)
19
            ->addAttribute('required', $this->required)
20
            ->addAttribute('placeholder', $this->placeholder);
21
    }
22
}
23