Completed
Push — master ( c73ac3...acbb41 )
by Serhii
34:37 queued 19:37
created

CustomerResponse   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 54
rs 10
wmc 4
lcom 1
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getCustomer() 0 4 1
A setCustomer() 0 6 1
A getApiKey() 0 4 1
1
<?php
2
3
namespace AppBundle\Model;
4
5
use AppBundle\Entity\Customer;
6
use JMS\Serializer\Annotation\Accessor;
7
use JMS\Serializer\Annotation\ExclusionPolicy;
8
use JMS\Serializer\Annotation\Expose;
9
use JMS\Serializer\Annotation\Type;
10
use Symfony\Component\Validator\Constraints as Assert;
11
12
/**
13
 * @ExclusionPolicy("all")
14
 */
15
class CustomerResponse
16
{
17
    /**
18
     * @var Customer
19
     *
20
     * @Type("AppBundle\Entity\Customer")
21
     * @Expose
22
     */
23
    protected $customer;
24
25
    /**
26
     * @var string
27
     *
28
     * @Type("string")
29
     * @Accessor(getter="getApiKey")
30
     * @Expose
31
     */
32
    protected $apiKey;
33
34
    /**
35
     * @param Customer $customer
36
     */
37
    public function __construct($customer)
38
    {
39
        $this->customer = $customer;
40
    }
41
42
    /**
43
     * @return Customer
44
     */
45
    public function getCustomer()
46
    {
47
        return $this->customer;
48
    }
49
50
    /**
51
     * @param  Customer $customer
52
     * @return $this
53
     */
54
    public function setCustomer($customer)
55
    {
56
        $this->customer = $customer;
57
58
        return $this;
59
    }
60
61
    /**
62
     * @return string
63
     */
64
    public function getApiKey()
65
    {
66
        return $this->getCustomer()->getApiKey();
67
    }
68
}
69