Update   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 80
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getText() 0 4 1
A setText() 0 5 1
A getDate() 0 4 1
A setDate() 0 5 1
A getType() 0 4 1
A setType() 0 5 1
1
<?php
2
namespace Wonnova\SDK\Model;
3
4
use JMS\Serializer\Annotation as JMS;
5
use Wonnova\SDK\Common\WonnovaDateTimeParserTrait;
6
7
/**
8
 * Class Update
9
 * @author Wonnova
10
 * @link http://www.wonnova.com
11
 */
12
class Update extends AbstractModel
13
{
14
    use WonnovaDateTimeParserTrait;
15
16
    const TYPE_ACTION       = 'action';
17
    const TYPE_INTERACTION  = 'interaction';
18
    const TYPE_BADGE        = 'badge';
19
    const TYPE_QUEST        = 'quest';
20
    const TYPE_LEVEL        = 'level';
21
22
    /**
23
     * @var string
24
     * @JMS\Type("string")
25
     */
26
    private $text;
27
    /**
28
     * @var \DateTime
29
     * @JMS\Type("WonnovaDateTime")
30
     */
31
    private $date;
32
    /**
33
     * @var string
34
     * @JMS\Type("string")
35
     */
36
    private $type;
37
38
    /**
39
     * @return string
40
     */
41 2
    public function getText()
42
    {
43 2
        return $this->text;
44
    }
45
46
    /**
47
     * @param string $text
48
     * @return $this
49
     */
50 1
    public function setText($text)
51
    {
52 1
        $this->text = $text;
53 1
        return $this;
54
    }
55
56
    /**
57
     * @return \DateTime
58
     */
59 2
    public function getDate()
60
    {
61 2
        return $this->date;
62
    }
63
64
    /**
65
     * @param \DateTime|array|string $date
66
     * @return $this
67
     */
68 1
    public function setDate($date)
69
    {
70 1
        $this->date = $this->parseWonnovaDateTime($date);
71 1
        return $this;
72
    }
73
74
    /**
75
     * @return string
76
     */
77 2
    public function getType()
78
    {
79 2
        return $this->type;
80
    }
81
82
    /**
83
     * @param string $type
84
     * @return $this
85
     */
86 1
    public function setType($type)
87
    {
88 1
        $this->type = $type;
89 1
        return $this;
90
    }
91
}
92