1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the G.L.S.R. Apps package. |
7
|
|
|
* |
8
|
|
|
* (c) Dev-Int Création <[email protected]>. |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
11
|
|
|
* file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Core\Domain\Model; |
15
|
|
|
|
16
|
|
|
use Administration\Domain\User\Model\User as UserDomain; |
17
|
|
|
use Administration\Domain\User\Model\VO\UserUuid; |
18
|
|
|
use Core\Domain\Common\Model\VO\EmailField; |
19
|
|
|
use Core\Domain\Common\Model\VO\NameField; |
20
|
|
|
use Symfony\Component\Security\Core\User\UserInterface; |
|
|
|
|
21
|
|
|
|
22
|
|
|
class User extends UserDomain implements UserInterface |
23
|
|
|
{ |
24
|
|
|
public static function create( |
25
|
|
|
UserUuid $uuid, |
26
|
|
|
NameField $username, |
27
|
|
|
EmailField $email, |
28
|
|
|
string $password, |
29
|
|
|
array $roles = [] |
30
|
|
|
): self { |
31
|
|
|
return new self($uuid, $username, $email, $password, $roles); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function getUuid(): string |
35
|
|
|
{ |
36
|
|
|
return $this->uuid()->toString(); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public function getUsername(): string |
40
|
|
|
{ |
41
|
|
|
return $this->username(); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public function getEmail(): string |
45
|
|
|
{ |
46
|
|
|
return $this->email()->getValue(); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public function getPassword(): string |
50
|
|
|
{ |
51
|
|
|
return $this->password(); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function getRoles(): array |
55
|
|
|
{ |
56
|
|
|
return \array_unique($this->roles()); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function getSalt(): ?string |
60
|
|
|
{ |
61
|
|
|
return null; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function eraseCredentials(): void |
65
|
|
|
{ |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @see AuthenticationSuccessResponseListener::onAuthenticationSuccessResponse |
70
|
|
|
*/ |
71
|
|
|
public function getProfileInfos(): array |
72
|
|
|
{ |
73
|
|
|
return [ |
74
|
|
|
'uuid' => $this->getUuid(), |
75
|
|
|
'username' => $this->getUsername(), |
76
|
|
|
'email' => $this->getEmail(), |
77
|
|
|
]; |
78
|
|
|
} |
79
|
|
|
} |
80
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths