| Conditions | 4 |
| Paths | 5 |
| Total Lines | 23 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public static function toArray(PaymentMethodNonce $object): array |
||
| 13 | { |
||
| 14 | if (null === $object) { |
||
| 15 | return []; |
||
| 16 | } |
||
| 17 | |||
| 18 | $array = ArrayUtils::extractPropertiesToArray($object, [ |
||
| 19 | 'nonce', 'consumed', 'default', 'type', 'threeDSecureInfo', 'details', |
||
| 20 | ]); |
||
| 21 | |||
| 22 | if (array_key_exists('threeDSecureInfo', $array)) { |
||
| 23 | $array['threeDSecureInfo'] = ArrayUtils::extractPropertiesToArray($array['threeDSecureInfo'], [ |
||
| 24 | 'enrolled', 'liabilityShiftPossible', 'liabilityShifted', 'status', |
||
| 25 | ]); |
||
| 26 | } |
||
| 27 | |||
| 28 | if (array_key_exists('details', $array)) { |
||
| 29 | $array['details'] = ArrayUtils::extractPropertiesToArray($array['details'], [ |
||
| 30 | 'cardType', 'lastTwo', 'correlationId', 'email', 'payerInfo', 'username', |
||
| 31 | ]); |
||
| 32 | } |
||
| 33 | |||
| 34 | return $array; |
||
| 35 | } |
||
| 37 |