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

SmsDetails::getSmsContent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Ittoolspl\Smslabs\Entity;
4
5
class SmsDetails
6
{
7
    private $id;
8
    private $from;
9
    private $numberTo;
10
    private $status;
11
    private $smsCount;
12
    private $smsContent;
13
    private $priceInGrosz;
14
15
    /**
16
     * SmsDetails constructor.
17
     * @param string $id
18
     * @param string $from
19
     * @param string $numberTo
20
     * @param int $status
21
     * @param int $smsCount
22
     * @param string $smsContent
23
     * @param double $priceInGrosz
24
     */
25 1
    public function __construct($id, $from, $numberTo, $status, $smsCount, $smsContent, $priceInGrosz)
26
    {
27 1
        $this->id           = $id;
28 1
        $this->from         = $from;
29 1
        $this->numberTo     = $numberTo;
30 1
        $this->status       = $status;
31 1
        $this->smsCount     = $smsCount;
32 1
        $this->smsContent   = $smsContent;
33 1
        $this->priceInGrosz = $priceInGrosz;
34 1
    }
35
36
    /**
37
     * Creates SmsDetails object by array
38
     * @param array $response
39
     * @return \Ittoolspl\Smslabs\Entity\SmsDetails
40
     */
41 1
    public static function createFromResponseArray(array $response)
42
    {
43 1
        return new self(
44 1
            $response['id'],
45 1
            $response['from'],
46 1
            $response['number_to'],
47 1
            $response['status'],
48 1
            $response['sms_count'],
49 1
            $response['sms_content'],
50 1
            ($response['price'] / 100)
51 1
        );
52
    }
53
54
    /**
55
     * @return string
56
     */
57 1
    public function getId()
58
    {
59 1
        return $this->id;
60
    }
61
62
    /**
63
     * @return string
64
     */
65 1
    public function getFrom()
66
    {
67 1
        return $this->from;
68
    }
69
70
    /**
71
     * @return string
72
     */
73 1
    public function getNumberTo()
74
    {
75 1
        return $this->numberTo;
76
    }
77
78
    /**
79
     * @return int
80
     */
81 1
    public function getStatus()
82
    {
83 1
        return $this->status;
84
    }
85
86
    /**
87
     * @return int
88
     */
89 1
    public function getSmsCount()
90
    {
91 1
        return $this->smsCount;
92
    }
93
94
    /**
95
     * @return string
96
     */
97 1
    public function getSmsContent()
98
    {
99 1
        return $this->smsContent;
100
    }
101
102
    /**
103
     * @return double
104
     */
105 1
    public function getPriceInGrosz()
106
    {
107 1
        return $this->priceInGrosz;
108
    }
109
}
110