TwitterMediaSize   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 83
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 83
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 getHeight() 0 4 1
A getName() 0 4 1
A getResize() 0 4 1
A getWidth() 0 4 1
A create() 0 11 1
1
<?php
2
3
namespace Twitter\Object;
4
5
use Twitter\TwitterSerializable;
6
7
class TwitterMediaSize implements TwitterSerializable
8
{
9
    /**
10
     * @var string
11
     */
12
    private $name;
13
14
    /**
15
     * @var int
16
     */
17
    private $width;
18
19
    /**
20
     * @var int
21
     */
22
    private $height;
23
24
    /**
25
     * @var boolean
26
     */
27
    private $resize;
28
29
    /**
30
     * Constructor.
31
     */
32 9
    public function __construct()
33
    {
34 9
    }
35
36
    /**
37
     * @return int
38
     */
39 9
    public function getHeight()
40
    {
41 9
        return $this->height;
42
    }
43
44
    /**
45
     * @return string
46
     */
47 6
    public function getName()
48
    {
49 6
        return $this->name;
50
    }
51
52
    /**
53
     * @return string
54
     */
55 9
    public function getResize()
56
    {
57 9
        return $this->resize;
58
    }
59
60
    /**
61
     * @return int
62
     */
63 9
    public function getWidth()
64
    {
65 9
        return $this->width;
66
    }
67
68
    /**
69
     * Static constructor.
70
     *
71
     * @param string  $name
72
     * @param int     $width
73
     * @param int     $height
74
     * @param boolean $resize
75
     *
76
     * @return TwitterMediaSize
77
     */
78 9
    public static function create($name, $width, $height, $resize)
79
    {
80 9
        $obj = new self();
81
82 9
        $obj->height = $height;
83 9
        $obj->name = $name;
84 9
        $obj->resize = $resize;
85 9
        $obj->width = $width;
86
87 9
        return $obj;
88
    }
89
}
90