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

Table   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 10 3
A getMetadata() 0 4 1
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