Completed
Push — master ( b82189...cfb751 )
by Janusz
02:03
created

Sender::createFromResponseObject()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 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
    /**
25
     * @param array $response
26
     * @return Sender
27
     */
28
    public static function createFromResponseArray(array $response)
29
    {
30
        return new self(
31
            $response['id'],
32
            $response['name'],
33
            $response['sender']
34
        );
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getId()
41
    {
42
        return $this->id;
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function getName()
49
    {
50
        return $this->name;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getSender()
57
    {
58
        return $this->sender;
59
    }
60
}
61