Test Setup Failed
Push — master ( a8f38f...93c046 )
by Fernando
07:40
created

User   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 24
dl 0
loc 77
ccs 29
cts 29
cp 1
c 1
b 0
f 0
rs 10
wmc 12

12 Methods

Rating   Name   Duplication   Size   Complexity  
A updateName() 0 5 1
A getPassword() 0 3 1
A updateCreatedAt() 0 5 1
A getCreatedAt() 0 3 1
A getUpdatedAt() 0 3 1
A getEmail() 0 3 1
A updatePassword() 0 5 1
A updateEmail() 0 5 1
A toJson() 0 3 1
A getName() 0 3 1
A getId() 0 3 1
A updateUpdatedAt() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Entity;
6
7
final class User
8
{
9
    private int $id;
10
    private string $name;
11
    private string $email;
12
    private string $password;
13
    private $createdAt;
14
    private $updatedAt;
15
16 4
    public function getId(): int
17
    {
18 4
        return $this->id;
19
    }
20
21 4
    public function getName(): string
22
    {
23 4
        return $this->name;
24
    }
25
26 4
    public function updateName(string $name): self
27
    {
28 4
        $this->name = $name;
29
30 4
        return $this;
31
    }
32
33 4
    public function getEmail(): ?string
34
    {
35 4
        return $this->email;
36
    }
37
38 3
    public function updateEmail(?string $email): self
39
    {
40 3
        $this->email = $email;
41
42 3
        return $this;
43
    }
44
45 2
    public function getPassword(): ?string
46
    {
47 2
        return $this->password;
48
    }
49
50 3
    public function updatePassword(?string $password): self
51
    {
52 3
        $this->password = $password;
53
54 3
        return $this;
55
    }
56
57 1
    public function getCreatedAt(): ?string
58
    {
59 1
        return $this->createdAt;
60
    }
61
62 2
    public function updateCreatedAt(?string $createdAt): self
63
    {
64 2
        $this->createdAt = $createdAt;
65
66 2
        return $this;
67
    }
68
69 1
    public function getUpdatedAt(): ?string
70
    {
71 1
        return $this->updatedAt;
72
    }
73
74 1
    public function updateUpdatedAt(?string $updatedAt): self
75
    {
76 1
        $this->updatedAt = $updatedAt;
77
78 1
        return $this;
79
    }
80
81 2
    public function toJson(): object
82
    {
83 2
        return json_decode((string) json_encode(get_object_vars($this)), false);
84
    }
85
}
86