1 | <?php |
||
12 | class AccessTokenService implements AccessTokenServiceInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var AccessTokenRepositoryInterface |
||
16 | */ |
||
17 | private $accessTokenRepository; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $accessTokenClass; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $defaultExpirationDuration = '+1 month'; |
||
28 | |||
29 | /** |
||
30 | * @var AuthenticationProviderInterface |
||
31 | */ |
||
32 | private $authenticationManager; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $authenticationProviderKey; |
||
38 | |||
39 | public function __construct( |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | public function createAccessToken(string $username, string $password): AccessToken |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | public function findUserByToken(string $token): ?UserInterface |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function listByUser(UserInterface $user): array |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | public function createAccessTokenForUser(UserInterface $user): AccessToken |
||
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | public function cleanUpExpiredTokens(): int |
||
108 | |||
109 | /** |
||
110 | * @return string |
||
111 | */ |
||
112 | public function getDefaultExpirationDuration() |
||
116 | |||
117 | /** |
||
118 | * @param string $defaultExpirationDuration |
||
119 | */ |
||
120 | public function setDefaultExpirationDuration($defaultExpirationDuration) |
||
124 | } |
||
125 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.