Submit   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
eloc 6
c 2
b 0
f 0
dl 0
loc 23
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 3 1
A __construct() 0 5 2
A getTag() 0 3 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