HtmlTag::attributes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 1
cts 1
cp 1
crap 1
rs 10
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