Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPStan - User::getPassword() #1540

Open
seb-jean opened this issue May 6, 2024 · 0 comments
Open

PHPStan - User::getPassword() #1540

seb-jean opened this issue May 6, 2024 · 0 comments

Comments

@seb-jean
Copy link
Contributor

seb-jean commented May 6, 2024

Hi,

With PHPStan, I have the following error:
Method App\Entity\User::getPassword() should return string but returns string|null.

The generated code is as follows:

// src/Entity/User.php

public function getPassword(): string
{
    return $this->password;
}

Instead we should have the code below:

// src/Entity/User.php

public function getPassword(): ?string
{
    return $this->password;
}
@seb-jean seb-jean changed the title PHPStan - User::getPassword PHPStan - User::getPassword() May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant