Achievement   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 4 1
A setType() 0 5 1
A getValue() 0 4 1
A setValue() 0 5 1
A getAllTypesList() 0 4 1
1
<?php
2
namespace Wonnova\SDK\Model;
3
4
use JMS\Serializer\Annotation as JMS;
5
6
/**
7
 * Class Achievement
8
 * @author Wonnova
9
 * @link http://www.wonnova.com
10
 */
11
class Achievement extends AbstractModel
12
{
13
    const TYPE_POINTS = 'points';
14
    const TYPE_LEVEL = 'level';
15
    const TYPE_BADGE = 'badges'; // In singular for consistency
16
    const TYPE_QUEST = 'quest';
17
18
    /**
19
     * Just an allias for TYPE_BADGE. This will be removed at some point if the public API is updated
20
     * @deprecated Use TYPE_BADGE constant instead.
21
     */
22
    const TYPE_BADGES = 'badges';
23
24
    /**
25
     * @var string
26
     * @JMS\Type("string")
27
     */
28
    private $type;
29
    /**
30
     * @var int
31
     * @JMS\Type("integer")
32
     */
33
    private $value;
34
35
    /**
36
     * @return mixed
37
     */
38 2
    public function getType()
39
    {
40 2
        return $this->type;
41
    }
42
43
    /**
44
     * @param mixed $type
45
     * @return $this
46
     */
47 1
    public function setType($type)
48
    {
49 1
        $this->type = $type;
50 1
        return $this;
51
    }
52
53
    /**
54
     * @return int
55
     */
56 2
    public function getValue()
57
    {
58 2
        return $this->value;
59
    }
60
61
    /**
62
     * @param int $value
63
     * @return $this
64
     */
65 1
    public function setValue($value)
66
    {
67 1
        $this->value = $value;
68 1
        return $this;
69
    }
70
71
    /**
72
     * Returns the list of valid types
73
     *
74
     * @return array
75
     */
76 2
    public static function getAllTypesList()
77
    {
78 2
        return [self::TYPE_BADGE, self::TYPE_LEVEL, self::TYPE_POINTS, self::TYPE_QUEST];
79
    }
80
}
81