Completed
Push — master ( bc0444...122bd3 )
by Andrii
01:23
created

Customer   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 45.45%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 47
ccs 5
cts 11
cp 0.4545
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getLogin() 0 4 1
A getSeller() 0 4 1
A jsonSerialize() 0 4 1
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\customer;
12
13
use hiqdev\php\billing\target\AbstractTarget;
14
15
/**
16
 * Customer.
17
 *
18
 * @author Andrii Vasyliev <[email protected]>
19
 */
20
class Customer extends AbstractTarget implements CustomerInterface
21
{
22
    /**
23
     * @var integer
24
     */
25
    protected $id;
26
27
    /**
28
     * @var string
29
     */
30
    protected $login;
31
32
    /**
33
     * @var CustomerInterface
34
     */
35
    protected $seller;
36
37
    /**
38
     * @var Customer[]
39
     */
40
    protected $sellers = [];
41
42 1
    public function __construct($id, $login, CustomerInterface $seller = null)
43
    {
44 1
        $this->id = $id;
45 1
        $this->login = $login;
46 1
        $this->seller = $seller;
47 1
    }
48
49
    /**
50
     * {@inheritdoc}
51
     */
52
    public function getLogin()
53
    {
54
        return $this->login;
55
    }
56
57
    public function getSeller()
58
    {
59
        return $this->seller;
60
    }
61
62
    public function jsonSerialize()
63
    {
64
        return get_object_vars($this);
65
    }
66
}
67