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

Table   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getMetadata() 0 4 1
A render() 0 12 3
1
<?php declare(strict_types=1);
2
3
namespace Formularium\Frontend\Bootstrap\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
16
        if ($parameters[HTMLTable::STRIPED] ?? false) {
17
            $previous->addAttribute('class', 'table-striped');
18
        }
19
        if ($parameters[HTMLTable::BORDERED] ?? false) {
20
            $previous->addAttribute('class', 'table-bordered');
21
        }
22
23
        return $previous;
24
    }
25
26
    public static function getMetadata(): Metadata
27
    {
28
        $metadata = HTMLTable::getMetadata();
29
        return $metadata;
30
    }
31
}
32