Fixed: force string on username

This commit is contained in:
Julien Fastré 2023-05-17 13:24:44 +02:00
parent db9fef095a
commit 8863e0a92e
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -506,11 +506,11 @@ class User implements UserInterface
*
* @return User
*/
public function setUsername($name)
public function setUsername(?string $name)
{
$this->username = $name;
$this->username = (string) $name;
if (empty($this->getLabel())) {
if ("" === trim($this->getLabel())) {
$this->setLabel($name);
}