TwitterDisconnect   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 76
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

6 Methods

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