Completed
Push — master ( e67ef9...d5a49f )
by Tobias
03:42
created

Tag::getDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * Copyright (C) 2013-2016 Mailgun
5
 *
6
 * This software may be modified and distributed under the terms
7
 * of the MIT license. See the LICENSE file for details.
8
 */
9
10
namespace Mailgun\Resource\Api\Tag;
11
12
class Tag
13
{
14
    /**
15
     * @var string
16
     */
17
    private $tag;
18
19
    /**
20
     * @var string
21
     */
22
    private $description;
23
24
    /**
25
     * @var \DateTime
26
     */
27
    private $firstSeen;
28
29
    /**
30
     * @var \DateTime
31
     */
32
    private $lastSeen;
33
34
    /**
35
     * @param string    $tag
36
     * @param string    $description
37
     * @param \DateTime $firstSeen
38
     * @param \DateTime $lastSeen
39
     */
40
    public function __construct($tag, $description, \DateTime $firstSeen, \DateTime $lastSeen)
41
    {
42
        $this->tag = $tag;
43
        $this->description = $description;
44
        $this->firstSeen = $firstSeen;
45
        $this->lastSeen = $lastSeen;
46
    }
47
48
    /**
49
     * @param array $data
50
     *
51
     * @return Tag
52
     */
53
    public static function create(array $data)
54
    {
55
        return new self($data['tag'], $data['description'], $data['first-seen'], $data['last-seen']);
56
    }
57
58
    /**
59
     * @return string
60
     */
61
    public function getTag()
62
    {
63
        return $this->tag;
64
    }
65
66
    /**
67
     * @return string
68
     */
69
    public function getDescription()
70
    {
71
        return $this->description;
72
    }
73
}
74