public static function fromResponseData(array $data): self
    {
        // @todo fix this as idle != duration.
        // @todo We need to store the date this token was created.
        static::validateData($data);
        $lifetime = (int) floor(min($data['signInResponse']['duration'], $data['signInResponse']['idleTimeout']) / 1000);
        $token = new self($data['signInResponse']['userId'], $data['signInResponse']['token'], $lifetime);

        return $token;
    }
public static function fromResponseData(array $data): self
    {
        // @todo fix this as idle != duration.
        // @todo We need to store the date this token was created.
        static::validateData($data);
        $lifetime = (int) floor(min($data['signInResponse']['duration'], $data['signInResponse']['idleTimeout']) / 1000);
        $token = new self($data['signInResponse']['userId'], $data['signInResponse']['token'], $lifetime);

        return $token;
    }
public static function fromResponseData ( array $ data ) : self { // @todo fix this as idle != duration. // @todo We need to store the date this token was created. static :: validateData ( $ data ) ; $ lifetime = ( int ) floor ( min ( $ data [ 'signInResponse' ] [ 'duration' ] , $ data [ 'signInResponse' ] [ 'idleTimeout' ] ) / 1000 ) ; $ token = new self ( $ data [ 'signInResponse' ] [ 'userId' ] , $ data [ 'signInResponse' ] [ 'token' ] , $ lifetime ) ; return $ token ; }
Create a token from an MPX signInResponse.

@todo Use something !array for the type.

@param array $data The MPX response data.

@return \Lullabot\Mpx\Token A new MPX token.
Create a token from an MPX signInResponse .