Completed
Push — master ( 77b660...93750f )
by Andrii
02:18
created

Customer::jsonSerialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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;
12
13
/**
14
 * Customer.
15
 *
16
 * @author Andrii Vasyliev <[email protected]>
17
 */
18
class Customer extends AbstractTarget implements CustomerInterface
19
{
20
    /**
21
     * @var integer
22
     */
23
    protected $id;
24
25
    /**
26
     * @var string
27
     */
28
    protected $login;
29
30
    /**
31
     * @var CustomerInterface
32
     */
33
    protected $seller;
34
35
    /**
36
     * @var Client[]
37
     */
38
    protected $sellers = [];
39
40
    public function __construct($id, $login, $seller = null)
41
    {
42
        $this->id = $id;
43
        $this->login = $login;
44
        $this->seller = $seller;
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public function getLogin()
51
    {
52
        return $this->login;
53
    }
54
55
    public function jsonSerialize()
56
    {
57
        return get_object_vars($this);
58
    }
59
}
60