PHP Class Lcobucci\JWT\Parser

Since: 0.1.0
Author: Luís Otávio Cobucci Oblonczyk ([email protected])
Show file Open project: lcobucci/jwt Class Usage Examples

Public Methods

Method Description
__construct ( Lcobucci\Jose\Parsing\Decoder $decoder, Factory $claimFactory ) Initializes the object
parse ( string $jwt ) : Token Parses the JWT and returns a token

Protected Methods

Method Description
parseClaims ( string $data ) : array Parses the claim set from a string
parseHeader ( string $data ) : array Parses the header from a string
parseSignature ( array $header, string $data ) : Lcobucci\JWT\Signature | null Returns the signature from given data
splitJwt ( string $jwt ) : array Splits the JWT string into an array

Method Details

__construct() public method

Initializes the object
public __construct ( Lcobucci\Jose\Parsing\Decoder $decoder, Factory $claimFactory )
$decoder Lcobucci\Jose\Parsing\Decoder
$claimFactory Lcobucci\JWT\Claim\Factory

parse() public method

Parses the JWT and returns a token
public parse ( string $jwt ) : Token
$jwt string
return Token

parseClaims() protected method

Parses the claim set from a string
protected parseClaims ( string $data ) : array
$data string
return array

parseHeader() protected method

Parses the header from a string
protected parseHeader ( string $data ) : array
$data string
return array

parseSignature() protected method

Returns the signature from given data
protected parseSignature ( array $header, string $data ) : Lcobucci\JWT\Signature | null
$header array
$data string
return Lcobucci\JWT\Signature | null

splitJwt() protected method

Splits the JWT string into an array
protected splitJwt ( string $jwt ) : array
$jwt string
return array