Completed
Push — fm-support ( bc372a...c8858b )
by Konstantinos
09:10
created

ColorTeam::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * This file contains functionality relating to the fun match teams
4
 *
5
 * @package    BZiON\Models
6
 * @license    https://github.com/allejo/bzion/blob/master/LICENSE.md GNU General Public License Version 3
7
 */
8
9
/**
10
 * A team identified by its color in BZFlag
11
 * @package    BZiON\Models
12
 */
13
class ColorTeam implements TeamInterface
14
{
15
    /**
16
     * The color of the team
17
     *
18
     * @var string
19
     */
20
    protected $color;
21
22
    /**
23
     * Define a new ColorTeam
24
     * @param string $color The color of the team
25
     */
26
    public function __construct($color)
27
    {
28
        $this->color = strtolower($color);
29
    }
30
31
    /**
32
     * Get a unique identifier for the team
33
     *
34
     * @return string
35
     */
36
    public function getId()
37
    {
38
        return $this->color;
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    public function getName()
45
    {
46
        return ucwords($this->color) . " Team";
47
    }
48
49
    public function getAvatar()
50
    {
51
        return "assets/imgs/team_" . $this->color . ".png";
52
    }
53
}
54