Closed MichaelKheel closed 1 year ago
Hi @MichaelKheel,
The AbstractPasswordToken::setUser($user)
method doesn't typehint the $user
argument, as it can be any class name. Your PasswordToken::setUser(User $user)
method typehints it, which does not respect the inheritance of the method in PHP. You must declare it as its parent:
public function setUser($user): self
{
$this->user = $user;
return $this;
}
If you want to typehint the $user
argument, please use the PHPDoc:
/**
* @param User $user
*/
public function setUser($user): self
{
$this->user = $user;
return $this;
}
The documentation has been updated accordingly.
Compile Error: Declaration of App\Entity\PasswordToken::setUser(App\Entity\User $user): App\Entity\PasswordToken must be compatible with CoopTilleuls\ForgotPasswordBundle\Entity\AbstractPasswordToken::setUser($user)
The User entity was created using the standard method from the documentation. What could be the problem? Symfony 6.2.0