mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Fixed some deprecations related to missing return types
This commit is contained in:
parent
eb24aa2e68
commit
294f7cf005
11 changed files with 20 additions and 21 deletions
|
@ -28,22 +28,21 @@ use Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface;
|
|||
use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Component\Validator\ConstraintValidator;
|
||||
use Symfony\Component\Validator\ConstraintValidatorInterface;
|
||||
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
|
||||
|
||||
class ValidGoogleAuthCodeValidatorTest extends ConstraintValidatorTestCase
|
||||
{
|
||||
|
||||
protected function createValidator()
|
||||
protected function createValidator(): ConstraintValidatorInterface
|
||||
{
|
||||
$googleAuth = new class implements GoogleAuthenticatorInterface
|
||||
{
|
||||
|
||||
public function checkCode(TwoFactorInterface $user, string $code): bool
|
||||
{
|
||||
if ($code === '123456') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return $code === '123456';
|
||||
}
|
||||
|
||||
public function getQRContent(TwoFactorInterface $user): string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue