OrderResponse   A
last analyzed

Complexity

Total Complexity 16

Size/Duplication

Total Lines 132
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 25
c 2
b 0
f 0
dl 0
loc 132
rs 10
wmc 16

15 Methods

Rating   Name   Duplication   Size   Complexity  
A getErrorString() 0 3 1
A getECodes() 0 3 1
A getErrorDetails() 0 3 1
A hasError() 0 3 1
A setECodes() 0 6 2
A setErrorString() 0 3 1
A setOrderId() 0 3 1
A getECode() 0 3 1
A setStatus() 0 3 1
A setErrorCode() 0 3 1
A setErrorDetails() 0 3 1
A setECode() 0 3 1
A getOrderId() 0 3 1
A getErrorCode() 0 3 1
A getStatus() 0 3 1
1
<?php
2
3
/**
4
 * Create an Order
5
 * https://docs.wegift.io/#9d98f03c-bd13-44e8-b208-e9cd108249cf
6
 */
7
8
namespace AllDigitalRewards\WeGift\Entity;
9
10
class OrderResponse extends AbstractEntity
11
{
12
    protected Ecode $e_code;
13
    /**
14
     * @var Ecode[]
15
     */
16
    protected array $e_codes = [];
17
    protected string $error_code;
18
    protected string $error_details;
19
    protected string $error_string;
20
    protected string $order_id;
21
    protected string $status;
22
23
    /**
24
     * @return Ecode
25
     */
26
    public function getECode(): Ecode
27
    {
28
        return $this->e_code;
29
    }
30
31
    /**
32
     * @param array $e_code
33
     */
34
    public function setECode(array $e_code): void
35
    {
36
        $this->e_code = new Ecode($e_code);
37
    }
38
39
    /**
40
     * @return Ecode[]
41
     */
42
    public function getECodes(): array
43
    {
44
        return $this->e_codes;
45
    }
46
47
    /**
48
     * @param array $e_codes
49
     */
50
    public function setECodes(array $e_codes): void
51
    {
52
        $this->e_codes = [];
53
54
        foreach ($e_codes as $e_code) {
55
            $this->e_codes[] = new Ecode($e_code);
56
        }
57
    }
58
59
    public function hasError(): bool
60
    {
61
        return isset($this->error_code);
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public function getErrorCode(): string
68
    {
69
        return $this->error_code;
70
    }
71
72
    /**
73
     * @param string $error_code
74
     */
75
    public function setErrorCode(string $error_code): void
76
    {
77
        $this->error_code = $error_code;
78
    }
79
80
    /**
81
     * @return string
82
     */
83
    public function getErrorDetails(): string
84
    {
85
        return $this->error_details;
86
    }
87
88
    /**
89
     * @param string $error_details
90
     */
91
    public function setErrorDetails(string $error_details): void
92
    {
93
        $this->error_details = $error_details;
94
    }
95
96
    /**
97
     * @return string
98
     */
99
    public function getErrorString(): string
100
    {
101
        return $this->error_string;
102
    }
103
104
    /**
105
     * @param string $error_string
106
     */
107
    public function setErrorString(string $error_string): void
108
    {
109
        $this->error_string = $error_string;
110
    }
111
112
    /**
113
     * @return string
114
     */
115
    public function getOrderId(): string
116
    {
117
        return $this->order_id;
118
    }
119
120
    /**
121
     * @param string $order_id
122
     */
123
    public function setOrderId(string $order_id): void
124
    {
125
        $this->order_id = $order_id;
126
    }
127
128
    /**
129
     * @return string
130
     */
131
    public function getStatus(): string
132
    {
133
        return $this->status;
134
    }
135
136
    /**
137
     * @param string $status
138
     */
139
    public function setStatus(string $status): void
140
    {
141
        $this->status = $status;
142
    }
143
}
144