Promotion::allowed()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Resova\Objects;
4
5
/**
6
 * The basket promotion object
7
 * The promotions object allows you to manage promotions for a basket.
8
 *
9
 * @codeCoverageIgnore
10
 * @package Resova\Models
11
 */
12
class Promotion
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 object.
23
            'type'     => 'string', // Can be: 'discount' or 'custom'.
24
            'amount'   => 'float',  // The amount of the discount.
25
            'discount' => 'object', // The discount object if the promotion type is 'discount'.
26
        ];
27
    }
28
29
}
30