Table   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 11
c 1
b 0
f 1
dl 0
loc 24
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 16 3
A getMetadata() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace Formularium\Frontend\Bootstrapvue\Element;
4
5
use Formularium\Element;
6
use Formularium\HTMLNode;
7
use Formularium\Metadata;
8
use Formularium\MetadataParameter;
9
use Formularium\Frontend\HTML\Element\Table as HTMLTable;
10
11
class Table extends Element
12
{
13
    public function render(array $parameters, HTMLNode $previous): HTMLNode
14
    {
15
        $node = HTMLNode::factory(
16
            'b-table',
17
            [
18
                ':items' => 'items' // TODO
19
            ]
20
        );
21
        if ($parameters[HTMLTable::STRIPED] ?? false) {
22
            $node->addAttribute(':striped', 'true');
23
        }
24
        if ($parameters[HTMLTable::BORDERED] ?? false) {
25
            $node->addAttribute(':bordered', 'true');
26
        }
27
28
        return $node;
29
    }
30
31
    public static function getMetadata(): Metadata
32
    {
33
        $metadata = HTMLTable::getMetadata();
34
        return $metadata;
35
    }
36
}
37