HtmlTag   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A attribute() 0 3 1
A tag() 0 3 1
A attributes() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace drupol\htmltag;
6
7
use drupol\htmltag\Attribute\AttributeFactory;
8
use drupol\htmltag\Attribute\AttributeInterface;
9
use drupol\htmltag\Attributes\AttributesFactory;
10
use drupol\htmltag\Attributes\AttributesInterface;
11
use drupol\htmltag\Tag\TagFactory;
12
use drupol\htmltag\Tag\TagInterface;
13
14
/**
15
 * Class HtmlTag.
16
 */
17 1
final class HtmlTag implements HtmlTagInterface
18
{
19 1
    public static function attribute(string $name, $value): AttributeInterface
20
    {
21
        return AttributeFactory::build($name, $value);
22
    }
23
24
    public static function attributes(array $attributes = []): AttributesInterface
25 1
    {
26
        return AttributesFactory::build($attributes);
27 1
    }
28
29
    public static function tag(string $name, array $attributes = [], $content = null): TagInterface
30
    {
31
        return TagFactory::build($name, $attributes, $content);
32
    }
33
}
34