Completed
Push — master ( 4a945d...f56bff )
by Andrii
02:24
created

Order::getActions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * PHP Billing Library
4
 *
5
 * @link      https://github.com/hiqdev/php-billing
6
 * @package   php-billing
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\php\billing\order;
12
13
use hiqdev\php\billing\customer\CustomerInterface;
14
15
/**
16
 * @author Andrii Vasyliev <[email protected]>
17
 */
18
class Order implements OrderInterface
19
{
20
    /**
21
     * @var int|string|null
22
     */
23
    protected $id;
24
25
    /**
26
     * @var CustomerInterface
27
     */
28
    protected $customer;
29
30
    /**
31
     * @var ActionInterface[] array: actionKey => action
32
     */
33
    protected $actions = [];
34
35
    public function __construct($id, CustomerInterface $customer, array $actions = [])
36
    {
37
        $this->id = $id;
38
        $this->customer = $customer;
39
        $this->actions = $actions;
40
    }
41
42
    public function getId()
43
    {
44
        return $this->id;
45
    }
46
47
    public function getCustomer()
48
    {
49
        return $this->customer;
50
    }
51
52
    /**
53
     * Returns actions.
54
     * @return ActionInterface[] array: actionKey => action
55
     */
56
    public function getActions()
57
    {
58
        return $this->actions;
59
    }
60
61
    public function jsonSerialize()
62
    {
63
        return get_object_vars($this);
64
    }
65
}
66