Consumer::setCustomId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace CCT\Kong\Model;
6
7
class Consumer
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $id;
13
14
    /**
15
     * @var string
16
     */
17
    protected $username;
18
19
    /**
20
     * @var string
21
     */
22
    protected $customId;
23
24
    /**
25
     * @var \DateTime
26
     */
27
    protected $createdAt;
28
29
    /**
30
     * Gets the consumer's identification;
31
     *
32
     * @return null|string
33
     */
34 7
    public function getId(): ?string
35
    {
36 7
        return $this->id;
37
    }
38
39
    /**
40
     * Sets the unique username of the consumer.
41
     *
42
     * @param string $username
43
     *
44
     * @return static
45
     */
46 3
    public function setUsername(string $username): self
47
    {
48 3
        $this->username = $username;
49
50 3
        return $this;
51
    }
52
53
    /**
54
     * Gets the unique username of the consumer.
55
     *
56
     * @return string
57
     */
58 1
    public function getUsername(): ?string
59
    {
60 1
        return $this->username;
61
    }
62
63
    /**
64
     * Sets the field for storing an existing unique ID for the consumer.
65
     *
66
     * @param string $customId
67
     *
68
     * @return static
69
     */
70 2
    public function setCustomId(string $customId): self
71
    {
72 2
        $this->customId = $customId;
73
74 2
        return $this;
75
    }
76
77
    /**
78
     * Gets the field for storing an existing unique ID for the consumer.
79
     *
80
     * @return null|string
81
     */
82 1
    public function getCustomId(): ?string
83
    {
84 1
        return $this->customId;
85
    }
86
87
    /**
88
     * Gets the date that the consumer was created.
89
     *
90
     * @return \DateTime
91
     */
92 2
    public function getCreatedAt(): ?\DateTime
93
    {
94 2
        return $this->createdAt;
95
    }
96
}