1 | <?php |
||
22 | class BaseUser implements User, Serializable, EquatableInterface |
||
23 | { |
||
24 | /** |
||
25 | * @var int |
||
26 | * |
||
27 | * @ORM\Column(type="integer") |
||
28 | * @ORM\Id |
||
29 | * @ORM\GeneratedValue |
||
30 | */ |
||
31 | protected $id; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | * |
||
36 | * @ORM\Column(type="string") |
||
37 | */ |
||
38 | protected $username; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | * |
||
43 | * @ORM\Column(type="string") |
||
44 | */ |
||
45 | protected $password; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | * |
||
50 | * @ORM\Column(type="string") |
||
51 | */ |
||
52 | protected $salt; |
||
53 | |||
54 | /** |
||
55 | * @var string |
||
56 | * |
||
57 | * @ORM\Column(type="string") |
||
58 | */ |
||
59 | protected $displayName; |
||
60 | |||
61 | /** |
||
62 | * @var PasswordResetToken |
||
63 | * |
||
64 | * @ORM\Column(type="string", nullable=true) |
||
65 | */ |
||
66 | protected $passwordResetToken; |
||
67 | |||
68 | /** |
||
69 | * @var string |
||
70 | * |
||
71 | * @ORM\Column(type="string") |
||
72 | */ |
||
73 | protected $email; |
||
74 | |||
75 | /** |
||
76 | * @var Status |
||
77 | * |
||
78 | * @ORM\Column(type="user_status") |
||
79 | */ |
||
80 | protected $status; |
||
81 | |||
82 | /** |
||
83 | * @var string |
||
84 | */ |
||
85 | protected $plainPassword; |
||
86 | |||
87 | /** |
||
88 | * @var Collection |
||
89 | * |
||
90 | * @ORM\ManyToMany(targetEntity="SumoCoders\FrameworkMultiUserBundle\Entity\UserRole") |
||
91 | */ |
||
92 | protected $roles; |
||
93 | |||
94 | /** |
||
95 | * @param string $username |
||
96 | * @param string $plainPassword |
||
97 | * @param string $displayName |
||
98 | * @param string $email |
||
99 | * @param Collection $roles |
||
100 | * @param int $id |
||
101 | * @param PasswordResetToken $token |
||
102 | */ |
||
103 | public function __construct( |
||
104 | string $username, |
||
105 | string $plainPassword, |
||
106 | string $displayName, |
||
107 | string $email, |
||
108 | Collection $roles, |
||
109 | int $id = null, |
||
110 | PasswordResetToken $token = null |
||
111 | ) { |
||
112 | $this->username = $username; |
||
113 | $this->plainPassword = $plainPassword; |
||
114 | $this->displayName = $displayName; |
||
115 | $this->email = $email; |
||
116 | $this->roles = $roles; |
||
117 | $this->id = $id; |
||
118 | |||
119 | // set the default status to active |
||
120 | $this->status = Status::active(); |
||
|
|||
121 | |||
122 | if ($token) { |
||
123 | $this->passwordResetToken = $token; |
||
124 | } |
||
125 | } |
||
126 | |||
127 | public function getRoles(): ?array |
||
128 | { |
||
129 | return $this->roles->toArray(); |
||
130 | } |
||
131 | |||
132 | public function getRolesAsCollection(): ?Collection |
||
133 | { |
||
134 | return $this->roles; |
||
135 | } |
||
136 | |||
137 | public function getPassword(): string |
||
141 | |||
142 | public function getSalt(): string |
||
146 | |||
147 | public function encodePassword(PasswordEncoderInterface $encoder): void |
||
160 | |||
161 | public function getUsername(): string |
||
165 | |||
166 | public function eraseCredentials(): void |
||
170 | |||
171 | public function getDisplayName(): string |
||
175 | |||
176 | public function __toString(): string |
||
180 | |||
181 | public function clearPasswordResetToken(): self |
||
187 | |||
188 | public function generatePasswordResetToken(): self |
||
194 | |||
195 | public function getPasswordResetToken(): ?PasswordResetToken |
||
199 | |||
200 | public function getEmail(): string |
||
204 | |||
205 | public function setPassword(string $password): self |
||
211 | |||
212 | public function getId(): int |
||
216 | |||
217 | public function hasPlainPassword(): bool |
||
221 | |||
222 | public function getPlainPassword(): string |
||
226 | |||
227 | public function change(UserDataTransferObject $data): void |
||
234 | |||
235 | public function toggleBlock(): void |
||
245 | |||
246 | public function isBlocked(): bool |
||
250 | |||
251 | public function canSwitchTo(BaseUser $user): bool |
||
255 | |||
256 | public function serialize(): string |
||
265 | |||
266 | public function unserialize($serialized): void |
||
270 | |||
271 | public function isEqualTo(UserInterface $user): bool |
||
279 | } |
||
280 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..