Test Failed
Push — develop ( ddb817...815500 )
by nguereza
02:28
created

UserParam::setUsername()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Platine\Framework\Demo\Form\Param;
4
5
use Platine\Orm\Entity;
6
7
class UserParam extends BaseParam
8
{
9
    protected string $username = '';
10
    protected string $lastname = '';
11
    protected string $firstname = '';
12
    protected string $password = '';
13
    protected string $age = '';
14
15
    public function fromEntity(Entity $entity): BaseParam
16
    {
17
        $this->username = $entity->username;
18
        $this->lastname = $entity->lname;
19
        $this->firstname = $entity->fname;
20
        $this->password = $entity->password;
21
        $this->age = $entity->age;
22
23
        return $this;
24
    }
25
26
    public function getUsername(): string
27
    {
28
        return $this->username;
29
    }
30
31
    public function setUsername(string $username): self
32
    {
33
        $this->username = $username;
34
35
        return $this;
36
    }
37
38
    public function getPassword(): string
39
    {
40
        return $this->password;
41
    }
42
43
    public function setPassword(string $password): self
44
    {
45
        $this->password = $password;
46
47
        return $this;
48
    }
49
50
    public function getLastname(): string
51
    {
52
        return $this->lastname;
53
    }
54
55
    public function getFirstname(): string
56
    {
57
        return $this->firstname;
58
    }
59
60
    public function getAge(): string
61
    {
62
        return $this->age;
63
    }
64
65
    public function setLastname(string $lastname): self
66
    {
67
        $this->lastname = $lastname;
68
        return $this;
69
    }
70
71
    public function setFirstname(string $firstname): self
72
    {
73
        $this->firstname = $firstname;
74
        return $this;
75
    }
76
77
    public function setAge(string $age): self
78
    {
79
        $this->age = $age;
80
        return $this;
81
    }
82
}
83