Completed
Pull Request — master (#137)
by
unknown
19:25 queued 05:24
created

CustomerResponse::getApiKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 0
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 4
    public function __construct($customer)
38
    {
39 4
        $this->customer = $customer;
40 4
    }
41
42
    /**
43
     * @return Customer
44
     */
45 4
    public function getCustomer()
46
    {
47 4
        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 4
    public function getApiKey()
65
    {
66 4
        return $this->getCustomer()->getApiKey();
67
    }
68
}
69