Passed
Pull Request — main (#3)
by Peter
07:02 queued 03:23
created

Help::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 4
dl 0
loc 10
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Framework\Form\Extra;
6
7
use AbterPhp\Framework\Constant\Html5;
8
use AbterPhp\Framework\Html\Attribute;
9
use AbterPhp\Framework\Html\Attributes;
10
use AbterPhp\Framework\Html\Component;
11
use AbterPhp\Framework\Html\INode;
12
13
class Help extends Component
14
{
15
    public const CLASS_HELP_BLOCK = 'help-block';
16
17
    protected const DEFAULT_TAG = Html5::TAG_DIV;
18
19
    /**
20
     * Help constructor.
21
     *
22
     * @param INode[]|INode|string|null $content
23
     * @param array                     $intents
24
     * @param Attributes|null           $attributes
25
     * @param string|null               $tag
26
     */
27
    public function __construct(
28
        $content = null,
29
        array $intents = [],
30
        ?Attributes $attributes = null,
31
        ?string $tag = null
32
    ) {
33
        $attributes ??= new Attributes();
34
        $attributes->mergeItem(new Attribute(Html5::ATTR_CLASS, self::CLASS_HELP_BLOCK));
35
36
        parent::__construct($content, $intents, $attributes, $tag);
37
    }
38
}
39