TwitterUserMention   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 79
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getId() 0 4 1
A getName() 0 4 1
A getScreenName() 0 4 1
A __toString() 0 4 1
A create() 0 12 1
1
<?php
2
3
namespace Twitter\Object;
4
5
use Twitter\TwitterBasicUser;
6
use Twitter\TwitterEntity;
7
8
class TwitterUserMention extends TwitterEntity implements TwitterBasicUser
9
{
10
    /**
11
     * @var int
12
     */
13
    private $id;
14
15
    /**
16
     * @var string
17
     */
18
    private $screenName;
19
20
    /**
21
     * @var string
22
     */
23
    private $name;
24
25
    /**
26
     * Construct.
27
     */
28 9
    public function __construct()
29
    {
30 9
    }
31
32
    /**
33
     * @return int
34
     */
35 9
    public function getId()
36
    {
37 9
        return $this->id;
38
    }
39
40
    /**
41
     * @return string
42
     */
43 9
    public function getName()
44
    {
45 9
        return $this->name;
46
    }
47
48
    /**
49
     * @return string
50
     */
51 9
    public function getScreenName()
52
    {
53 9
        return $this->screenName;
54
    }
55
56
    /**
57
     * @return string
58
     */
59 3
    public function __toString()
60
    {
61 3
        return '@' . $this->screenName;
62
    }
63
64
    /**
65
     * Static constructor.
66
     *
67
     * @param int                  $id
68
     * @param string               $screenName
69
     * @param string               $name
70
     * @param TwitterEntityIndices $indices
71
     *
72
     * @return TwitterUserMention
73
     */
74 9
    public static function create($id, $screenName, $name, TwitterEntityIndices $indices)
75
    {
76 9
        $obj = new self();
77
78 9
        $obj->initTwitterEntity($indices);
79
80 9
        $obj->id = $id;
81 9
        $obj->name = $name;
82 9
        $obj->screenName = $screenName;
83
84 9
        return $obj;
85
    }
86
}
87