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

BackGroundFactory::create()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 13
ccs 8
cts 8
cp 1
rs 9.4285
c 1
b 0
f 0
cc 2
eloc 9
nc 2
nop 3
crap 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