Fixed some more phpstan issues

This commit is contained in:
Jan Böhmer 2023-06-18 00:00:58 +02:00
parent 2f46fbfc7a
commit e8771ea118
77 changed files with 192 additions and 109 deletions

View file

@ -43,25 +43,25 @@ class U2FKey implements LegacyU2FKeyInterface
* @var string
**/
#[ORM\Column(type: Types::STRING, length: 128)]
public string $keyHandle;
public string $keyHandle = '';
/**
* @var string
**/
#[ORM\Column(type: Types::STRING)]
public string $publicKey;
public string $publicKey = '';
/**
* @var string
**/
#[ORM\Column(type: Types::TEXT)]
public string $certificate;
public string $certificate = '';
/**
* @var int
* @var string
**/
#[ORM\Column(type: Types::STRING)]
public int $counter;
public string $counter = '0';
#[ORM\Id]
#[ORM\Column(type: Types::INTEGER)]
@ -72,7 +72,7 @@ class U2FKey implements LegacyU2FKeyInterface
* @var string
**/
#[ORM\Column(type: Types::STRING)]
protected string $name;
protected string $name = '';
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'u2fKeys')]
protected ?User $user = null;
@ -114,7 +114,7 @@ class U2FKey implements LegacyU2FKeyInterface
return $this;
}
public function getCounter(): int
public function getCounter(): string
{
return $this->counter;
}

View file

@ -900,7 +900,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
{
return new PublicKeyCredentialUserEntity(
$this->getUsername(),
(string) $this->getId(),
(string) $this->getID(),
$this->getFullName(),
);
}

View file

@ -25,6 +25,7 @@ namespace App\Entity\UserSystem;
use Doctrine\DBAL\Types\Types;
use App\Entity\Base\TimestampTrait;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints\NotBlank;
use Webauthn\PublicKeyCredentialSource as BasePublicKeyCredentialSource;
#[ORM\Entity]
@ -40,7 +41,8 @@ class WebauthnKey extends BasePublicKeyCredentialSource
protected int $id;
#[ORM\Column(type: Types::STRING)]
protected string $name;
#[NotBlank]
protected string $name = '';
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'webauthn_keys')]
protected ?User $user = null;