@@ -121,13 +121,11 @@ public function setDigits(?int $digits): TwoFactorUser
121121 return $ this ;
122122 }
123123
124- #[\Override]
125124 public function isTotpAuthenticationEnabled (): bool
126125 {
127126 return (bool ) $ this ->secret && null !== $ this ->activatedAt ;
128127 }
129128
130- #[\Override]
131129 public function getTotpAuthenticationUsername (): string
132130 {
133131 if (null === $ this ->user ) {
@@ -137,14 +135,12 @@ public function getTotpAuthenticationUsername(): string
137135 return $ this ->user ->getUserIdentifier ();
138136 }
139137
140- #[\Override]
141138 public function getTotpAuthenticationConfiguration (): ?TotpConfigurationInterface
142139 {
143140 // You could persist the other configuration options in the user entity to make it individual per user.
144141 return new TotpConfiguration ($ this ->secret , $ this ->getAlgorithm (), $ this ->getPeriod (), $ this ->getDigits ());
145142 }
146143
147- #[\Override]
148144 public function isGoogleAuthenticatorEnabled (): bool
149145 {
150146 return (bool ) $ this ->secret
@@ -155,7 +151,6 @@ public function isGoogleAuthenticatorEnabled(): bool
155151 ;
156152 }
157153
158- #[\Override]
159154 public function getGoogleAuthenticatorUsername (): string
160155 {
161156 if (null === $ this ->user ) {
@@ -165,7 +160,6 @@ public function getGoogleAuthenticatorUsername(): string
165160 return $ this ->user ->getUserIdentifier ();
166161 }
167162
168- #[\Override]
169163 public function getGoogleAuthenticatorSecret (): ?string
170164 {
171165 return $ this ->secret ;
@@ -174,12 +168,11 @@ public function getGoogleAuthenticatorSecret(): ?string
174168 /**
175169 * Check if it is a valid backup code.
176170 */
177- #[\Override]
178171 public function isBackupCode (string $ code ): bool
179172 {
180173 // Loop over all backup codes and check if the code is valid
181174 foreach ($ this ->backupCodes as $ backupCode ) {
182- if (password_verify ($ code , ( string ) $ backupCode )) {
175+ if (password_verify ($ code , $ backupCode )) {
183176 return true ;
184177 }
185178 }
@@ -190,12 +183,11 @@ public function isBackupCode(string $code): bool
190183 /**
191184 * Invalidate a backup code.
192185 */
193- #[\Override]
194186 public function invalidateBackupCode (string $ code ): void
195187 {
196188 // Loop over all backup codes and check if the code is valid to invalidate it
197189 foreach ($ this ->backupCodes as $ key => $ backupCode ) {
198- if (password_verify ($ code , ( string ) $ backupCode )) {
190+ if (password_verify ($ code , $ backupCode )) {
199191 unset($ this ->backupCodes [$ key ]);
200192 $ this ->backupCodes = array_values ($ this ->backupCodes );
201193 }
@@ -212,7 +204,6 @@ public function addBackUpCode(string $backUpCode): void
212204 }
213205 }
214206
215- #[\Override]
216207 public function getTrustedTokenVersion (): int
217208 {
218209 return $ this ->trustedVersion ;
0 commit comments