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

User::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 11
ccs 9
cts 9
cp 1
crap 1
rs 10
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