Completed
Push — master ( 533e78...e97401 )
by Janusz
02:11
created

Sender   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A createFromResponseArray() 0 8 1
A getId() 0 4 1
A getName() 0 4 1
A getSender() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Ittoolspl\Smslabs\VO;
5
6
class Sender
7
{
8
    /**
9
     * @var string
10
     */
11
    private $id;
12
13
    /**
14
     * @var string
15
     */
16
    private $name;
17
18
    /**
19
     * @var string
20
     */
21
    private $sender;
22
23
    /**
24
     * Sender constructor.
25
     * @param string $id
26
     * @param string $name
27
     * @param string $sender
28
     */
29
    public function __construct(string $id, string $name, string $sender)
30
    {
31
        $this->id     = $id;
32
        $this->name   = $name;
33
        $this->sender = $sender;
34
    }
35
36
    /**
37
     * @param array $response
38
     * @return Sender
39
     */
40
    public static function createFromResponseArray(array $response) : Sender
41
    {
42
        return new self(
43
            $response['id'],
44
            $response['name'],
45
            $response['sender']
46
        );
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getId() : string
53
    {
54
        return $this->id;
55
    }
56
57
    /**
58
     * @return string
59
     */
60
    public function getName() : string
61
    {
62
        return $this->name;
63
    }
64
65
    /**
66
     * @return string
67
     */
68
    public function getSender() : string
69
    {
70
        return $this->sender;
71
    }
72
}
73