PHP Класс Lcobucci\JWT\Token

С версии: 0.1.0
Автор: Luís Otávio Cobucci Oblonczyk ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( array $headers = ['alg' => 'none'], array $claims = [], Lcobucci\JWT\Signature $signature = null, array $payload = ['', ''] ) Initializes the object
__toString ( ) : string Returns an encoded representation of the token
getClaim ( string $name, mixed $default = null ) : mixed Returns the value of a token claim
getClaims ( ) : array Returns the token claim set
getHeader ( string $name, mixed $default = null ) : mixed Returns the value of a token header
getHeaders ( ) : array Returns the token headers
getPayload ( ) : string Returns the token payload
hasClaim ( string $name ) : boolean Returns if the claim is configured
hasHeader ( string $name ) : boolean Returns if the header is configured
isExpired ( DateTimeInterfac\DateTimeInterface $now = null ) : boolean Determine if the token is expired.
validate ( ValidationData $data ) : boolean Validates if the token is valid
verify ( Lcobucci\JWT\Signer $signer, Lcobucci\JWT\Signer\Key | string $key ) : boolean Verify if the key matches with the one that created the signature

Приватные методы

Метод Описание
getHeaderValue ( string $name ) : mixed Returns the value stored in header
getValidatableClaims ( ) : Generator Yields the validatable claims

Описание методов

__construct() публичный метод

Initializes the object
public __construct ( array $headers = ['alg' => 'none'], array $claims = [], Lcobucci\JWT\Signature $signature = null, array $payload = ['', ''] )
$headers array
$claims array
$signature Lcobucci\JWT\Signature
$payload array

__toString() публичный метод

Returns an encoded representation of the token
public __toString ( ) : string
Результат string

getClaim() публичный метод

Returns the value of a token claim
public getClaim ( string $name, mixed $default = null ) : mixed
$name string
$default mixed
Результат mixed

getClaims() публичный метод

Returns the token claim set
public getClaims ( ) : array
Результат array

getHeader() публичный метод

Returns the value of a token header
public getHeader ( string $name, mixed $default = null ) : mixed
$name string
$default mixed
Результат mixed

getHeaders() публичный метод

Returns the token headers
public getHeaders ( ) : array
Результат array

getPayload() публичный метод

Returns the token payload
public getPayload ( ) : string
Результат string

hasClaim() публичный метод

Returns if the claim is configured
public hasClaim ( string $name ) : boolean
$name string
Результат boolean

hasHeader() публичный метод

Returns if the header is configured
public hasHeader ( string $name ) : boolean
$name string
Результат boolean

isExpired() публичный метод

Determine if the token is expired.
public isExpired ( DateTimeInterfac\DateTimeInterface $now = null ) : boolean
$now DateTimeInterfac\DateTimeInterface Defaults to the current time.
Результат boolean

validate() публичный метод

Validates if the token is valid
public validate ( ValidationData $data ) : boolean
$data ValidationData
Результат boolean

verify() публичный метод

Verify if the key matches with the one that created the signature
public verify ( Lcobucci\JWT\Signer $signer, Lcobucci\JWT\Signer\Key | string $key ) : boolean
$signer Lcobucci\JWT\Signer
$key Lcobucci\JWT\Signer\Key | string
Результат boolean