Skip to content

PHPStan - User::getPassword() #1540

Open
@seb-jean

Description

@seb-jean

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions