Completed
Push — master ( 46f89e...ea4efb )
by Janusz
09:47
created

Sender   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 52
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A createFromResponseObject() 0 8 1
A getId() 0 4 1
A getName() 0 4 1
A getSender() 0 4 1
1
<?php
2
3
namespace Ittoolspl\Smslabs\Entity;
4
5
class Sender
6
{
7
    private $id;
8
    private $name;
9
    private $sender;
10
11
    /**
12
     * Sender constructor.
13
     * @param string $id
14
     * @param string $name
15
     * @param string $sender
16
     */
17
    public function __construct($id, $name, $sender)
18
    {
19
        $this->id     = $id;
20
        $this->name   = $name;
21
        $this->sender = $sender;
22
    }
23
24
    public static function createFromResponseObject(\stdClass $respObj)
25
    {
26
        return new self(
27
            $respObj->id,
28
            $respObj->name,
29
            $respObj->sender
30
        );
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getId()
37
    {
38
        return $this->id;
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function getName()
45
    {
46
        return $this->name;
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getSender()
53
    {
54
        return $this->sender;
55
    }
56
}
57