Passed
Push — master ( e9a045...995df3 )
by Mr
02:09
created

GiftVoucher::allowed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 0
loc 10
ccs 0
cts 10
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Resova\Models;
4
5
use Resova\Model;
6
7
/**
8
 * The gift voucher object
9
 * Gift vouchers are types of gifts that can be purchased by customers,
10
 * ie "Gift voucher for £10.00", which when purchased will generated
11
 * a redeemable gift code.
12
 *
13
 * @package Resova\Models
14
 */
15
class GiftVoucher extends Model
16
{
17
    /**
18
     * List of allowed fields
19
     *
20
     * @return array
21
     */
22
    public function allowed(): array
23
    {
24
        return [
25
            'id'           => 'int',    // The unique id for the object.
26
            'name'         => 'string', // The name of the gift voucher.
27
            'amount'       => 'float',  // The purchase amount for this gift voucher.
28
            'voucher_type' => 'string', // Can be: value or spaces.
29
            'discount'     => 'float',  // The discountable amount for a gift code belonging to this voucher.
30
            'description'  => 'string', // The description of how the gift voucher is applied.
31
            'status'       => 'bool',   // True if the gift voucher is active.
32
        ];
33
    }
34
}
35