GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

TransactionArray::toArray()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 23
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 23
rs 9.7
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BitBag\SyliusBraintreePlugin\Reply\Api;
6
7
use BitBag\SyliusBraintreePlugin\Util\ArrayUtils;
8
use Braintree\Transaction;
9
10
final class TransactionArray
11
{
12
    public static function toArray(Transaction $object): array
13
    {
14
        if (null === $object) {
15
            return [];
16
        }
17
18
        $array = ArrayUtils::extractPropertiesToArray($object, [
19
            'id', 'status', 'type', 'currentIsoCode', 'amount',
20
            'merchantAccountId', 'subMerchantAccountId', 'masterMerchantAccountId',
21
            'orderId', 'createdAt', 'updatedAt', 'customer', 'billing', 'refundId',
22
            'refundIds', 'refundedTransactionId', 'partialSettlementTransactionIds',
23
            'authorizedTransactionId', 'settlementBatchId', 'shipping', 'customFields',
24
            'avsErrorResponseCode', 'avsPostalCodeResponseCode', 'avsStreetAddressResponseCode',
25
            'cvvResponseCode', 'gatewayRejectionReason', 'processorAuthorizationCode',
26
            'processorResponseCode', 'processorResponseText', 'additionalProcessorResponse',
27
            'voiceReferralNumber', 'purchaseOrderNumber', 'taxAmount', 'taxExempt', 'creditCard',
28
            'planId', 'subscriptionId', 'subscription', 'addOns', 'discounts', 'recurring',
29
            'channel', 'serviceFeeAmount', 'escrowStatus', /*disbursementDetails,*/
30
            'paymentInstrumentType', 'processorSettlementResponseCode',
31
            'processorSettlementResponseText', 'threeDSecureInfo', /*, creditCardDetails */
32
        ]);
33
34
        return $array;
35
    }
36
}
37