Conditions | 3 |
Paths | 4 |
Total Lines | 36 |
Code Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Tests | 21 |
CRAP Score | 3.0368 |
Changes | 0 |
1 | <?php |
||
25 | 1 | public function toArray(): array |
|
26 | { |
||
27 | 1 | $request = []; |
|
28 | |||
29 | 1 | if ($this->description ?? null) { |
|
30 | $request[] = [ |
||
31 | 'op' => 'replace', |
||
32 | 'path' => '/description', |
||
33 | 'value' => $this->description |
||
34 | ]; |
||
35 | } |
||
36 | |||
37 | 1 | if ($this->paymentPreferences ?? null) { |
|
38 | 1 | $request[] = [ |
|
39 | 1 | 'op' => 'replace', |
|
40 | 1 | 'path' => '/payment_preferences/auto_bill_outstanding', |
|
41 | 1 | 'value' => $this->paymentPreferences->isAutoBillOutstanding() |
|
42 | ]; |
||
43 | 1 | $request[] = [ |
|
44 | 1 | 'op' => 'replace', |
|
45 | 1 | 'path' => '/payment_preferences/payment_failure_threshold', |
|
46 | 1 | 'value' => $this->paymentPreferences->getPaymentFailureThreshold() |
|
47 | ]; |
||
48 | 1 | $request[] = [ |
|
49 | 1 | 'op' => 'replace', |
|
50 | 1 | 'path' => '/payment_preferences/setup_fee_failure_action', |
|
51 | 1 | 'value' => $this->paymentPreferences->getSetupFeeFailureAction() |
|
52 | ]; |
||
53 | 1 | $request[] = [ |
|
54 | 1 | 'op' => 'replace', |
|
55 | 1 | 'path' => '/payment_preferences/setup_fee', |
|
56 | 1 | 'value' => $this->paymentPreferences->getSetupFee()->toArray() |
|
57 | ]; |
||
58 | } |
||
59 | |||
60 | 1 | return $request; |
|
61 | } |
||
63 |