TwitterHashtag::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Twitter\Object;
4
5
use Twitter\TwitterEntity;
6
7
class TwitterHashtag extends TwitterEntity
8
{
9
    /**
10
     * @var string
11
     */
12
    private $text;
13
14
    /**
15
     * Constructor.
16
     */
17 9
    public function __construct()
18
    {
19 9
    }
20
21
    /**
22
     * @return string
23
     */
24 9
    public function getText()
25
    {
26 9
        return $this->text;
27
    }
28
29 3
    public function __toString()
30
    {
31 3
        return '#' . $this->getText();
32
    }
33
34
    /**
35
     * Static constructor.
36
     *
37
     * @param string               $text
38
     * @param TwitterEntityIndices $indices
39
     *
40
     * @return TwitterHashtag
41
     */
42 9
    public static function create($text, TwitterEntityIndices $indices)
43
    {
44 9
        $obj = new self();
45
46 9
        $obj->initTwitterEntity($indices);
47
48 9
        $obj->text = $text;
49
50 9
        return $obj;
51
    }
52
}
53