Table   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 38
rs 10
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setData() 0 3 1
A getData() 0 3 1
A getComponent() 0 12 2
A __construct() 0 4 1
1
<?php namespace FlatPlan\Components;
2
3
class Table extends AbstractComponent {
4
5
    protected $data;
6
7
    protected $roles = ['htmltable'];
8
9
    /**
10
     * @param string $role
11
     * @return void
12
     */
13
    public function __construct($role, $data)
14
    {
15
        $this->setRole($role);
16
        $this->setData($data);
17
    }
18
19
    public function setData($data)
20
    {
21
        $this->data = $data;
22
    }
23
24
    public function getData()
25
    {
26
        return $this->data;
27
    }
28
29
    public function getComponent()
30
    {
31
        $component = new \stdClass();
32
        $component->role      = $this->getRole();
33
        $component->data      = $this->getData();
34
        $component->layout    = $this->getLayout();
35
        $component->style     = $this->getStyle();
36
        $component->textStyle = $this->getTextStyle();
37
        if (!is_null($this->behaviour)) {
38
            $component->behaviour = $this->getBehaviour();
39
        }
40
        return $component;
41
    }
42
}
43