TwitterHashtag   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 46
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getText() 0 4 1
A __toString() 0 4 1
A create() 0 10 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