Purchase   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A allowed() 0 13 1
1
<?php
2
3
namespace Resova\Objects;
4
5
/**
6
 * The basket purchase object
7
 * The purchase object allows you to manage purchases for a basket.
8
 *
9
 * @codeCoverageIgnore
10
 * @package Resova\Models
11
 */
12
class Purchase
13
{
14
    /**
15
     * List of allowed fields
16
     *
17
     * @return array
18
     */
19
    public function allowed(): array
20
    {
21
        return [
22
            'id'             => 'int',    // The unique id for the purchase object.
23
            'price'          => 'float',  // The basket purchase subtotal.
24
            'discount'       => 'float',  // The total discount value of the basket purchase.
25
            'fee'            => 'float',  // The fee value of the basket purchase.
26
            'tax'            => 'float',  // The tax value of the basket purchase.
27
            'total'          => 'float',  // The total for the basket.
28
            'total_quantity' => 'int', // The total quantity of the purchase.
29
            'gift_voucher'   => 'GiftVoucher',  // The gift voucher object
30
            'gift_email'     => 'string',  // Gift email for the purchase
31
            'gift_message'   => 'string',  // Gift message for the purchase
32
        ];
33
    }
34
35
}
36