Link Search Menu Expand Document


Back to index

Author: Daniil Gentili

Represents a login QR code.


  • $link: non-empty-string The QR code login link
  • $expiry: positive-int The expiry date of the link

Method list:


isExpired(): bool

Returns true if the QR code has expired and a new one should be fetched.

expiresIn(): int

Returns the number of seconds until the QR code expires.

getExpirationCancellation(): \Amp\Cancellation

See also:

  • \Amp\Cancellation

getLoginCancellation(): \Amp\Cancellation

See also:

  • \Amp\Cancellation

waitForLoginOrQrCodeExpiration(\Amp\Cancellation|null $customCancellation = NULL): ?self

Waits for the user to login or for the QR code to expire. If the user logins, null is returned.

If the QR code expires, the new QR code is returned.

If cancellation is requested externally through $cancellation, a CancelledException is thrown.


  • $customCancellation: \Amp\Cancellation|null Optional additional cancellation

See also:

  • \Amp\Cancellation

getQRSvg(int $size = 400, int $margin = 4): string

Render and return SVG version of QR code.


  • $size: int
  • $margin: int

getQRText(int $margin = 2): string

Render and return plain text version of QR code.


  • $margin: int

Generated by danog/phpdoc