Badge::getMetadata()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Formularium\Frontend\HTML\Element;
4
5
use Formularium\Element;
6
use Formularium\HTMLNode;
7
use Formularium\Metadata;
8
9
class Badge extends Element
10
{
11
    public function render(array $parameters, HTMLNode $previous): HTMLNode
12
    {
13
        $node = new HTMLNode('span');
14
15
        $node->setAttributes([
16
            'class' => 'formularium-badge',
17
        ]);
18
19
        $node->setContent($parameters[self::LABEL]);
20
21
        return $node;
22
    }
23
24
    public static function getMetadata(): Metadata
25
    {
26
        return new Metadata(
27
            'Badge',
28
            'Creates a badge field',
29
            [
30
            ]
31
        );
32
    }
33
}
34