Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
47 | public function getMandatoryFields(): array |
||
48 | { |
||
49 | $return = [ |
||
50 | 'shipping_query_id', |
||
51 | 'ok', |
||
52 | ]; |
||
53 | |||
54 | // Shipping options are mandatory if ok is set to true, otherwise, error_message is |
||
55 | if ($this->ok === true) { |
||
56 | $return[] = 'shipping_options'; |
||
57 | } else { |
||
58 | $return[] = 'error_message'; |
||
59 | } |
||
60 | |||
61 | return $return; |
||
62 | } |
||
63 | } |
||
64 |