Image   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Enjoys\Forms\Elements;
6
7
use Enjoys\Forms\AttributeFactory;
8
use Enjoys\Forms\Element;
9
10
class Image extends Element
11
{
12
    protected string $type = 'image';
13
14 3
    public function __construct(string $name, ?string $src = null)
15
    {
16 3
        parent::__construct($name);
17 3
        if (!is_null($src)) {
18 1
            $this->setAttribute(AttributeFactory::create('src', $src));
19
        }
20
    }
21
}
22