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

Dashboard::__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\Dashboard;
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
12
class Dashboard extends Component
13
{
14
    protected const DEFAULT_TAG = Html5::TAG_DIV;
15
16
    protected const CLASS_DASHBOARD = 'dashboard-container';
17
18
    public function __construct(
19
        $content = null,
20
        array $intents = [],
21
        ?Attributes $attributes = null,
22
        ?string $tag = null
23
    ) {
24
        $attributes ??= new Attributes();
25
        $attributes->mergeItem(new Attribute(Html5::ATTR_CLASS, self::CLASS_DASHBOARD));
26
27
        parent::__construct($content, $intents, $attributes, $tag);
28
    }
29
}
30