Completed
Push — master ( 84b0d6...bfba9a )
by Janusz
02:28 queued 36s
created

Sender   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 56
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

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
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 1
    public function __construct($id, $name, $sender)
18
    {
19 1
        $this->id     = $id;
20 1
        $this->name   = $name;
21 1
        $this->sender = $sender;
22 1
    }
23
24
    /**
25
     * @param array $response
26
     * @return Sender
27
     */
28 1
    public static function createFromResponseArray(array $response)
29
    {
30 1
        return new self(
31 1
            $response['id'],
32 1
            $response['name'],
33 1
            $response['sender']
34 1
        );
35
    }
36
37
    /**
38
     * @return string
39
     */
40 1
    public function getId()
41
    {
42 1
        return $this->id;
43
    }
44
45
    /**
46
     * @return string
47
     */
48 1
    public function getName()
49
    {
50 1
        return $this->name;
51
    }
52
53
    /**
54
     * @return string
55
     */
56 1
    public function getSender()
57
    {
58 1
        return $this->sender;
59
    }
60
}
61