Promotion   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A allowed() 0 7 1
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