Skip to content

Commit

Permalink
bug #1550 [make:user] fix getPassword() return type in certain inst…
Browse files Browse the repository at this point in the history
…ance with `PasswordAuthenticatedUserInterface`

* Update UserClassBuilder.php

* fix nullable return type

---------

Co-authored-by: Jesse Rushlow <jr@rushlow.dev>
  • Loading branch information
seb-jean and jrushlow authored Jun 17, 2024
1 parent c2bfa32 commit 2d1007f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Security/UserClassBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ private function addGetPassword(ClassSourceManipulator $manipulator, UserClassCo
'password',
'getPassword',
'string',
false,
true,
[
'@see PasswordAuthenticatedUserInterface',
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function setRoles(array $roles): static
/**
* @see PasswordAuthenticatedUserInterface
*/
public function getPassword(): string
public function getPassword(): ?string
{
return $this->password;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function setRoles(array $roles): static
/**
* @see PasswordAuthenticatedUserInterface
*/
public function getPassword(): string
public function getPassword(): ?string
{
return $this->password;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function setRoles(array $roles): static
/**
* @see PasswordAuthenticatedUserInterface
*/
public function getPassword(): string
public function getPassword(): ?string
{
return $this->password;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function setRoles(array $roles): static
/**
* @see PasswordAuthenticatedUserInterface
*/
public function getPassword(): string
public function getPassword(): ?string
{
return $this->password;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Security/fixtures/expected/UserModelWithPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function setRoles(array $roles): static
/**
* @see PasswordAuthenticatedUserInterface
*/
public function getPassword(): string
public function getPassword(): ?string
{
return $this->password;
}
Expand Down

0 comments on commit 2d1007f

Please sign in to comment.