Passed
Push — dev ( 4d4f83...13e3b4 )
by Janko
20:05
created

UserRegistration::setMobile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Orm\Entity;
6
7
use Doctrine\ORM\Mapping\Column;
8
use Doctrine\ORM\Mapping\Entity;
9
use Doctrine\ORM\Mapping\Id;
10
use Doctrine\ORM\Mapping\JoinColumn;
11
use Doctrine\ORM\Mapping\OneToOne;
12
use Doctrine\ORM\Mapping\Table;
13
use Override;
0 ignored issues
show
Bug introduced by
The type Override was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
15
#[Table(name: 'stu_user_registration')]
16
#[Entity]
17
class UserRegistration implements UserRegistrationInterface
18
{
19
    #[Id]
20
    #[OneToOne(targetEntity: 'User', inversedBy: 'registration')]
21
    #[JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
22
    private UserInterface $user;
23
24
    #[Column(type: 'string', length: 20)]
25
    private string $login = '';
26
27
    #[Column(type: 'string', length: 255)]
28
    private string $pass = '';
29
30
    #[Column(type: 'string', length: 6, nullable: true)]
31
    private ?string $sms_code = null;
32
33
    #[Column(type: 'string', length: 200)]
34
    private string $email = '';
35
36
    #[Column(type: 'string', length: 255, nullable: true)]
37
    private ?string $mobile = null;
38
39
    #[Column(type: 'integer')]
40
    private int $creation = 0;
41
42
    #[Column(type: 'smallint')]
43
    private int $delmark = 0;
44
45
    #[Column(type: 'string', length: 255)]
46
    private string $password_token = '';
47
48
    #[Column(type: 'integer', nullable: true, options: ['default' => 1])]
49
    private ?int $sms_sended = 1;
50
51
    #[OneToOne(targetEntity: 'UserReferer', mappedBy: 'userRegistration')]
52
    private ?UserRefererInterface $referer = null;
53
54
    public function __construct(UserInterface $user)
55
    {
56
        $this->user = $user;
57
    }
58
59
    #[Override]
60
    public function getLogin(): string
61
    {
62
        return $this->login;
63
    }
64
65
    #[Override]
66
    public function setLogin(string $login): UserRegistrationInterface
67
    {
68
        $this->login = $login;
69
        return $this;
70
    }
71
72
    #[Override]
73
    public function getPassword(): string
74
    {
75
        return $this->pass;
76
    }
77
78
    #[Override]
79
    public function setPassword(string $password): UserRegistrationInterface
80
    {
81
        $this->pass = $password;
82
        return $this;
83
    }
84
85
    #[Override]
86
    public function getSmsCode(): ?string
87
    {
88
        return $this->sms_code;
89
    }
90
91
    #[Override]
92
    public function setSmsCode(?string $code): UserRegistrationInterface
93
    {
94
        $this->sms_code = $code;
95
        return $this;
96
    }
97
98 1
    #[Override]
99
    public function getEmail(): string
100
    {
101 1
        return $this->email;
102
    }
103
104
    #[Override]
105
    public function setEmail(string $email): UserRegistrationInterface
106
    {
107
        $this->email = $email;
108
        return $this;
109
    }
110
111
    #[Override]
112
    public function getMobile(): ?string
113
    {
114
        return $this->mobile;
115
    }
116
117
    #[Override]
118
    public function setMobile(?string $mobile): UserRegistrationInterface
119
    {
120
        $this->mobile = $mobile;
121
        return $this;
122
    }
123
124 1
    #[Override]
125
    public function getCreationDate(): int
126
    {
127 1
        return $this->creation;
128
    }
129
130
    #[Override]
131
    public function setCreationDate(int $creationDate): UserRegistrationInterface
132
    {
133
        $this->creation = $creationDate;
134
        return $this;
135
    }
136
137
    #[Override]
138
    public function getDeletionMark(): int
139
    {
140
        return $this->delmark;
141
    }
142
143
    #[Override]
144
    public function setDeletionMark(int $deletionMark): UserRegistrationInterface
145
    {
146
        $this->delmark = $deletionMark;
147
        return $this;
148
    }
149
150 1
    #[Override]
151
    public function getPasswordToken(): string
152
    {
153 1
        return $this->password_token;
154
    }
155
156
    #[Override]
157
    public function setPasswordToken(string $password_token): UserRegistrationInterface
158
    {
159
        $this->password_token = $password_token;
160
        return $this;
161
    }
162
163
    #[Override]
164
    public function getReferer(): ?UserRefererInterface
165
    {
166
        return $this->referer;
167
    }
168
169
    #[Override]
170
    public function setReferer(?UserRefererInterface $referer): UserRegistrationInterface
171
    {
172
        $this->referer = $referer;
173
        return $this;
174
    }
175
176
    #[Override]
177
    public function getSmsSended(): int
178
    {
179
        return $this->sms_sended ?? 1;
180
    }
181
182
    #[Override]
183
    public function setSmsSended(int $smsSended): UserRegistrationInterface
184
    {
185
        $this->sms_sended = $smsSended;
186
        return $this;
187
    }
188
}
189