Completed
Push — dev ( 845ef5...8eacd8 )
by
unknown
02:50
created

BackGroundFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 16
ccs 8
cts 8
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 13 2
1
<?php
2
3
namespace eXpansion\Framework\Core\Model\Gui\Factory;
4
5
use FML\Controls\Quad;
6
use FML\Controls\Quads\Quad_BgsPlayerCard;
7
8
/**
9
 * Class LineBuilder
10
 *
11
 * @package eXpansion\Framework\Core\Model\Gui\Builders;
12
 * @author  oliver de Cramer <[email protected]>
13
 */
14
class BackGroundFactory
15
{
16 7
    public function create($width, $height, $index = 0)
17
    {
18 7
        $index = $index % 2;
19
20 7
        $background = new Quad();
21 7
        $background->setSize($width, $height);
22 7
        if ($index == 0) {
23 7
            $background->setBackgroundColor("eee5");
24
        } else {
25 6
            $background->setBackgroundColor("eee3");
26
        }
27 7
        return $background;
28
    }
29
}
30