private array
$badges =
[];
private array
$attributes =
[];
/**
* @param CredentialsInterface $credentials The credentials to check for this authentication, use
* SelfValidatingPassport if no credentials should be checked
* @param BadgeInterface[] $badges
*/
public function __construct(UserBadge
$userBadge, CredentialsInterface
$credentials, array
$badges =
[]) { $this->
addBadge($userBadge);
$this->
addBadge($credentials);
foreach ($badges as $badge) { $this->
addBadge($badge);
} } public function getUser(): UserInterface
{ if (!
isset($this->user
)) { if (!
$this->
hasBadge(UserBadge::
class)) { throw new \
LogicException('Cannot get the Security user, no username or UserBadge configured for this passport.'
);
}