1 | <?php |
||
9 | class Charge |
||
10 | { |
||
11 | const AMOUNT = 'vpc_Amount'; |
||
12 | const BATCH_NO = 'vpc_BatchNo'; |
||
13 | const CARD = 'vpc_Card'; |
||
14 | const LOCALE = 'vpc_Locale'; |
||
15 | const MERCH_TXN_REF = 'vpc_MerchTxnRef'; |
||
16 | const ORDER_INFO = 'vpc_OrderInfo'; |
||
17 | const RECEIPT_NO = 'vpc_ReceiptNo'; |
||
18 | const TRANSACTION_NO = 'vpc_TransactionNo'; |
||
19 | |||
20 | /** |
||
21 | * |
||
22 | * @var ResponseCode |
||
23 | */ |
||
24 | public $responseCode; |
||
25 | public $amount; |
||
26 | public $batchNo; |
||
27 | public $card; |
||
28 | public $locale; |
||
29 | public $merchTxnRef; |
||
30 | public $orderInfo; |
||
31 | public $receiptNo; |
||
32 | public $transactionNo; |
||
33 | public $responseContent; |
||
34 | private $failedValidation = false; |
||
35 | |||
36 | 15 | public function __construct($params) |
|
41 | |||
42 | 15 | private function formDecode(string $params) : void |
|
65 | |||
66 | /** |
||
67 | * |
||
68 | * @throws RequiredArgumentException |
||
69 | * @throws Exception |
||
70 | */ |
||
71 | 15 | private function validate() : void |
|
77 | |||
78 | 6 | public function isSuccess() : bool |
|
85 | |||
86 | 3 | public function getMessage() : string |
|
90 | |||
91 | 3 | public function toArray() : array |
|
106 | } |
||
107 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.