ReportResponse   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 48
rs 10
wmc 6

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 3
A getStatus() 0 2 1
A getData() 0 2 1
A getMessage() 0 2 1
1
<?php
2
3
namespace Cryptommer\Smsir\Objects;
4
5
use Psr\Http\Message\StreamInterface;
6
7
class ReportResponse {
8
9
    /**
10
     * @var String
11
     */
12
    public string $Status;
13
14
    /**
15
     * @var string
16
     */
17
    public string $Message;
18
19
    /**
20
     * @var ReportData|ReportData[]
21
     */
22
    public $Data;
23
24
    public function __construct($response) {
25
        $this->Status = $response['status'];
26
        $this->Message = $response['message'];
27
        if (array_key_exists('messageId', $response['data'])) {
28
            $this->Data = new ReportData($response['data']);
29
        } else {
30
            foreach ($response['data'] as $data) {
31
                $this->Data[] = new ReportData($data);
32
            }
33
        }
34
    }
35
36
    /**
37
     * @return ReportData|ReportData[]
38
     */
39
    public function getData(): ReportData {
40
        return $this->Data;
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getMessage(): string {
47
        return $this->Message;
48
    }
49
50
    /**
51
     * @return String
52
     */
53
    public function getStatus(): string {
54
        return $this->Status;
55
    }
56
57
58
}
59