Passed
Push — master ( edc575...08ade3 )
by Bruno
07:00
created

Table::getMetadata()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Formularium\Frontend\Bulma\Element;
4
5
use Formularium\Element;
6
use Formularium\HTMLNode;
7
use Formularium\Metadata;
8
use Formularium\Frontend\HTML\Element\Table as HTMLTable;
9
10
class Table extends Element
11
{
12
    public function render(array $parameters, HTMLNode $previous): HTMLNode
13
    {
14
        $previous->addAttribute('class', 'table');
15
        if ($parameters[HTMLTable::STRIPED] ?? false) {
16
            $previous->addAttribute('class', 'is-striped');
17
        }
18
        if ($parameters[HTMLTable::BORDERED] ?? false) {
19
            $previous->addAttribute('class', 'is-bordered');
20
        }
21
        return $previous;
22
    }
23
24
    public static function getMetadata(): Metadata
25
    {
26
        $metadata = HTMLTable::getMetadata();
27
        return $metadata;
28
    }
29
}
30