Completed
Pull Request — master (#51)
by De Cramer
02:45
created

LabelFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 20
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 14 2
1
<?php
2
3
namespace eXpansion\Framework\Core\Model\Gui\Factory;
4
use FML\Controls\Label;
5
6
/**
7
 * Class LineBuilder
8
 *
9
 * @package eXpansion\Framework\Core\Model\Gui\Builders;
10
 * @author  oliver de Cramer <[email protected]>
11
 */
12
class LabelFactory
13
{
14
    const TYPE_NORMAL = "normal";
15
    const TYPE_TITLE = 'title';
16
17
    public function create($text, $translate = false, $type = self::TYPE_NORMAL)
18
    {
19
        $label = new Label();
20
        $label->setText($text)
21
            ->setTextSize(2)
22
            ->setHeight(4)
23
            ->setTranslate($translate);
24
25
        if ($type == self::TYPE_TITLE) {
26
            $label->setTextFont('RajdhaniMono');
27
        }
28
29
        return $label;
30
    }
31
}
32