TwitterUser::__toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Twitter\Object;
4
5
use Twitter\TwitterBasicUser;
6
use Twitter\TwitterSerializable;
7
8
class TwitterUser implements TwitterBasicUser, TwitterSerializable
9
{
10
    /**
11
     * @var int
12
     */
13
    private $id;
14
15
    /**
16
     * @var string
17
     */
18
    private $name;
19
20
    /**
21
     * @var string
22
     */
23
    private $screenName;
24
25
    /**
26
     * @var string
27
     */
28
    private $location;
29
30
    /**
31
     * @var string
32
     */
33
    private $lang;
34
35
    /**
36
     * @var string
37
     */
38
    private $profileImageUrl;
39
40
    /**
41
     * @var string
42
     */
43
    private $profileImageUrlHttps;
44
45
    /**
46
     * Constructor.
47
     */
48 9
    public function __construct()
49
    {
50 9
    }
51
52
    /**
53
     * @return int
54
     */
55 9
    public function getId()
56
    {
57 9
        return $this->id;
58
    }
59
60
    /**
61
     * @return string
62
     */
63 9
    public function getLang()
64
    {
65 9
        return $this->lang;
66
    }
67
68
    /**
69
     * @return string
70
     */
71 9
    public function getLocation()
72
    {
73 9
        return $this->location;
74
    }
75
76
    /**
77
     * @return string
78
     */
79 9
    public function getName()
80
    {
81 9
        return $this->name;
82
    }
83
84
    /**
85
     * @return string
86
     */
87 9
    public function getProfileImageUrl()
88
    {
89 9
        return $this->profileImageUrl;
90
    }
91
92
    /**
93
     * @return string
94
     */
95 9
    public function getProfileImageUrlHttps()
96
    {
97 9
        return $this->profileImageUrlHttps;
98
    }
99
100
    /**
101
     * @return string
102
     */
103 9
    public function getScreenName()
104
    {
105 9
        return $this->screenName;
106
    }
107
108
    /**
109
     * @return string
110
     */
111 3
    public function __toString()
112
    {
113 3
        return '@' . $this->screenName;
114
    }
115
116
    /**
117
     * Static constructor.
118
     *
119
     * @param int    $id
120
     * @param string $screenName
121
     * @param string $name
122
     * @param string $lang
123
     * @param string $location
124
     * @param string $profileImageUrl
125
     * @param string $profileImageUrlHttps
126
     *
127
     * @return TwitterUser
128
     */
129 9
    public static function create(
130
        $id = null,
131
        $screenName = null,
132
        $name = null,
133
        $lang = 'en',
134
        $location = null,
135
        $profileImageUrl = null,
136
        $profileImageUrlHttps = null
137
    ) {
138 9
        $obj = new self();
139
140 9
        $obj->id = $id;
141
142 9
        $obj->screenName = $screenName;
143 9
        $obj->name = $name;
144
145 9
        $obj->lang = $lang;
146 9
        $obj->location = $location;
147
148 9
        $obj->profileImageUrl = $profileImageUrl;
149 9
        $obj->profileImageUrlHttps = $profileImageUrlHttps;
150
151 9
        return $obj;
152
    }
153
}
154