diff --git a/src/Security/UserClassBuilder.php b/src/Security/UserClassBuilder.php index 261780368..e99af57dc 100644 --- a/src/Security/UserClassBuilder.php +++ b/src/Security/UserClassBuilder.php @@ -232,7 +232,7 @@ private function addGetPassword(ClassSourceManipulator $manipulator, UserClassCo 'password', 'getPassword', 'string', - false, + true, [ '@see PasswordAuthenticatedUserInterface', ] diff --git a/tests/Security/fixtures/expected/UserEntityWithEmailAsIdentifier.php b/tests/Security/fixtures/expected/UserEntityWithEmailAsIdentifier.php index 71d2e49fa..d053ec604 100644 --- a/tests/Security/fixtures/expected/UserEntityWithEmailAsIdentifier.php +++ b/tests/Security/fixtures/expected/UserEntityWithEmailAsIdentifier.php @@ -83,7 +83,7 @@ public function setRoles(array $roles): static /** * @see PasswordAuthenticatedUserInterface */ - public function getPassword(): string + public function getPassword(): ?string { return $this->password; } diff --git a/tests/Security/fixtures/expected/UserEntityWithPassword.php b/tests/Security/fixtures/expected/UserEntityWithPassword.php index dc4999299..ae4158d56 100644 --- a/tests/Security/fixtures/expected/UserEntityWithPassword.php +++ b/tests/Security/fixtures/expected/UserEntityWithPassword.php @@ -78,7 +78,7 @@ public function setRoles(array $roles): static /** * @see PasswordAuthenticatedUserInterface */ - public function getPassword(): string + public function getPassword(): ?string { return $this->password; } diff --git a/tests/Security/fixtures/expected/UserEntityWithUser_IdentifierAsIdentifier.php b/tests/Security/fixtures/expected/UserEntityWithUser_IdentifierAsIdentifier.php index a77a08fed..709982a4a 100644 --- a/tests/Security/fixtures/expected/UserEntityWithUser_IdentifierAsIdentifier.php +++ b/tests/Security/fixtures/expected/UserEntityWithUser_IdentifierAsIdentifier.php @@ -78,7 +78,7 @@ public function setRoles(array $roles): static /** * @see PasswordAuthenticatedUserInterface */ - public function getPassword(): string + public function getPassword(): ?string { return $this->password; } diff --git a/tests/Security/fixtures/expected/UserModelWithEmailAsIdentifier.php b/tests/Security/fixtures/expected/UserModelWithEmailAsIdentifier.php index 062108367..d08e3b66e 100644 --- a/tests/Security/fixtures/expected/UserModelWithEmailAsIdentifier.php +++ b/tests/Security/fixtures/expected/UserModelWithEmailAsIdentifier.php @@ -67,7 +67,7 @@ public function setRoles(array $roles): static /** * @see PasswordAuthenticatedUserInterface */ - public function getPassword(): string + public function getPassword(): ?string { return $this->password; } diff --git a/tests/Security/fixtures/expected/UserModelWithPassword.php b/tests/Security/fixtures/expected/UserModelWithPassword.php index 6c4dcafc5..fd2e86898 100644 --- a/tests/Security/fixtures/expected/UserModelWithPassword.php +++ b/tests/Security/fixtures/expected/UserModelWithPassword.php @@ -62,7 +62,7 @@ public function setRoles(array $roles): static /** * @see PasswordAuthenticatedUserInterface */ - public function getPassword(): string + public function getPassword(): ?string { return $this->password; }