Fixed PHPstan issues for level 5.

This commit is contained in:
Jan Böhmer 2020-02-01 19:42:28 +01:00
parent a9293b7ceb
commit da72f5b3ec
24 changed files with 87 additions and 49 deletions

View file

@ -103,9 +103,10 @@ class U2FKey implements TwoFactorKeyInterface
return $this->keyHandle;
}
public function setKeyHandle($keyHandle): void
public function setKeyHandle($keyHandle): self
{
$this->keyHandle = $keyHandle;
return $this;
}
public function getPublicKey()
@ -113,9 +114,10 @@ class U2FKey implements TwoFactorKeyInterface
return $this->publicKey;
}
public function setPublicKey($publicKey): void
public function setPublicKey($publicKey): self
{
$this->publicKey = $publicKey;
return $this;
}
public function getCertificate()
@ -123,9 +125,10 @@ class U2FKey implements TwoFactorKeyInterface
return $this->certificate;
}
public function setCertificate($certificate): void
public function setCertificate($certificate): self
{
$this->certificate = $certificate;
return $this;
}
public function getCounter()
@ -133,9 +136,10 @@ class U2FKey implements TwoFactorKeyInterface
return $this->counter;
}
public function setCounter($counter): void
public function setCounter($counter): self
{
$this->counter = $counter;
return $this;
}
public function getName()
@ -143,9 +147,10 @@ class U2FKey implements TwoFactorKeyInterface
return $this->name;
}
public function setName($name): void
public function setName($name): self
{
$this->name = $name;
return $this;
}
/**
@ -173,7 +178,7 @@ class U2FKey implements TwoFactorKeyInterface
*
* @return $this
*/
public function setUser(TwoFactorInterface $new_user): self
public function setUser(User $new_user): self
{
$this->user = $new_user;

View file

@ -234,7 +234,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
*/
protected $attachments;
/** @var DateTime The time when the backup codes were generated
/** @var DateTime|null The time when the backup codes were generated
* @ORM\Column(type="datetime", nullable=true)
*/
protected $backupCodesGenerationDate;
@ -351,9 +351,9 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/**
* @see UserInterface
*/
public function getSalt(): void
public function getSalt(): ?string
{
// not needed when using the "bcrypt" algorithm in security.yaml
return null;
}
/**