Total Complexity | 9 |
Total Lines | 95 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class CancelResponse |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * Amazon Gift Card gcId. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $_id; |
||
22 | |||
23 | /** |
||
24 | * Amazon Gift Card creationRequestId |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $_creation_request_id; |
||
29 | |||
30 | /** |
||
31 | * Amazon Gift Card status |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $_status; |
||
36 | |||
37 | /** |
||
38 | * Amazon Gift Card Raw JSON |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $_raw_json; |
||
43 | |||
44 | /** |
||
45 | * Response constructor. |
||
46 | * @param $jsonResponse |
||
47 | */ |
||
48 | public function __construct($jsonResponse) |
||
49 | { |
||
50 | $this->_raw_json = $jsonResponse; |
||
51 | $this->_status = TRUE; |
||
|
|||
52 | $this->parseJsonResponse($jsonResponse); |
||
53 | } |
||
54 | |||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | public function getId(): string |
||
60 | { |
||
61 | return $this->_id; |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return string |
||
66 | */ |
||
67 | public function getCreationRequestId(): string |
||
68 | { |
||
69 | return $this->_creation_request_id; |
||
70 | } |
||
71 | |||
72 | |||
73 | /** |
||
74 | * @return string |
||
75 | */ |
||
76 | public function getStatus(): string |
||
79 | } |
||
80 | |||
81 | |||
82 | /** |
||
83 | * @return string |
||
84 | */ |
||
85 | public function getRawJson(): string |
||
88 | } |
||
89 | |||
90 | |||
91 | /** |
||
92 | * @param $jsonResponse |
||
93 | * @return CancelResponse |
||
94 | */ |
||
95 | public function parseJsonResponse($jsonResponse): self |
||
108 | |||
109 | } |
||
110 | |||
111 | } |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.