Submit::init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Del\Form\Field;
6
7
class Submit extends FieldAbstract
8
{
9
10 6
    public function getTag(): string
11
    {
12 6
        return 'input';
13
    }
14
15 10
    public function init()
16
    {
17 10
        $this->setAttribute('type', 'submit');
18
    }
19
20
    /**
21
     * Submit constructor.
22
     * @param $name
23
     * @param null $value
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $value is correct as it would always require null to be passed?
Loading history...
24
     */
25 10
    public function __construct(string $name, string $value = null)
26
    {
27 10
        $value = is_null($value) ? $name : $value;
28 10
        parent::__construct($name, $value);
29 10
        $this->setClass('btn btn-primary');
30
    }
31
}
32