Completed
Push — master ( 0b05ef...ba9f5c )
by Mr
02:22
created

Purchase   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 1
eloc 12
c 2
b 0
f 1
dl 0
loc 20
ccs 0
cts 13
cp 0
rs 10

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
 * @package Resova\Objects
10
 */
11
class Purchase
12
{
13
    /**
14
     * List of allowed fields
15
     *
16
     * @return array
17
     */
18
    public function allowed(): array
19
    {
20
        return [
21
            'id'             => 'int',    // The unique id for the purchase object.
22
            'price'          => 'float',  // The basket purchase subtotal.
23
            'discount'       => 'float',  // The total discount value of the basket purchase.
24
            'fee'            => 'float',  // The fee value of the basket purchase.
25
            'tax'            => 'float',  // The tax value of the basket purchase.
26
            'total'          => 'float',  // The total for the basket.
27
            'total_quantity' => 'int', // The total quantity of the purchase.
28
            'gift_voucher'   => 'object:GiftVoucher',  // The gift voucher object
29
            'gift_email'     => 'string',  // Gift email for the purchase
30
            'gift_message'   => 'string',  // Gift message for the purchase
31
        ];
32
    }
33
34
}
35