public function parse($token)
    {
        $parts = explode('.', $token);
        if (count($parts) !== 3) {
            throw new InvalidArgumentException('Token is invalid');
        }
        $this->token = $token;
        $this->header = json_decode(base64_decode($parts[0]), true);
        $this->payload = json_decode(base64_decode($parts[1]), true);
        $this->signature = $parts[2];
    }
public function parse($token)
    {
        $parts = explode('.', $token);
        if (count($parts) !== 3) {
            throw new InvalidArgumentException('Token is invalid');
        }
        $this->token = $token;
        $this->header = json_decode(base64_decode($parts[0]), true);
        $this->payload = json_decode(base64_decode($parts[1]), true);
        $this->signature = $parts[2];
    }
public function parse ( $ token ) { $ parts = explode ( '.' , $ token ) ; if ( count ( $ parts ) !== 3 ) { throw new InvalidArgumentException ( 'Token is invalid' ) ; } $ this -> token = $ token ; $ this -> header = json_decode ( base64_decode ( $ parts [ 0 ] ) , true ) ; $ this -> payload = json_decode ( base64_decode ( $ parts [ 1 ] ) , true ) ; $ this -> signature = $ parts [ 2 ] ; }
Parse a Token

@param string $token
@throws InvalidArgumentException
Parse a Token