SelfValidatingPassport
extends Passport
in package
An implementation used when there are no credentials to be checked (e.g.
API token authentication).
Tags
Table of Contents
Properties
- $user : mixed
- $attributes : array<string|int, mixed>
- $badges : array<string|int, mixed>
Methods
- __construct() : mixed
- addBadge() : $this
- Adds a new security badge.
- getAttribute() : mixed
- getAttributes() : array<string|int, mixed>
- getBadge() : BadgeInterface|null
- getBadges() : array<BadgeInterface>, BadgeInterface>
- getUser() : UserInterface
- hasBadge() : bool
- setAttribute() : void
Properties
$user
protected
mixed
$user
$attributes
private
array<string|int, mixed>
$attributes
= []
$badges
private
array<string|int, mixed>
$badges
= []
Methods
__construct()
public
__construct(UserBadge $userBadge[, array<string|int, BadgeInterface> $badges = [] ]) : mixed
Parameters
- $userBadge : UserBadge
- $badges : array<string|int, BadgeInterface> = []
addBadge()
Adds a new security badge.
public
addBadge(BadgeInterface $badge) : $this
A passport can hold only one instance of the same security badge. This method replaces the current badge if it is already set on this passport.
Parameters
- $badge : BadgeInterface
Return values
$thisgetAttribute()
public
getAttribute(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
- $default : mixed = null
getAttributes()
public
getAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>getBadge()
public
getBadge(string $badgeFqcn) : BadgeInterface|null
Parameters
- $badgeFqcn : string
Return values
BadgeInterface|nullgetBadges()
public
getBadges() : array<BadgeInterface>, BadgeInterface>
Return values
array<BadgeInterface>, BadgeInterface>getUser()
public
getUser() : UserInterface
Return values
UserInterfacehasBadge()
public
hasBadge(string $badgeFqcn) : bool
Parameters
- $badgeFqcn : string
Return values
boolsetAttribute()
public
setAttribute(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed