# danog\MadelineProto\TL\Types\LoginQrCode: Represents a login QR code.

[Back to index](../../../../index.html)

> Author: Daniil Gentili <daniil@daniil.it>  
  

Represents a login QR code.  



## Properties
* `$link`: `non-empty-string` The [QR code login link](https://core.telegram.org/api/links#qr-code-login-links)
* `$expiry`: `positive-int` The expiry date of the link

## Method list:
* [`isExpired(): bool`](#isExpired)
* [`expiresIn(): non-negative-int`](#expiresIn)
* [`getExpirationCancellation(): \Amp\Cancellation`](#getExpirationCancellation)
* [`getLoginCancellation(): \Amp\Cancellation`](#getLoginCancellation)
* [`waitForLoginOrQrCodeExpiration((\Amp\Cancellation|null) $customCancellation = NULL): ?\danog\MadelineProto\TL\Types\LoginQrCode`](#waitForLoginOrQrCodeExpiration)
* [`getQRSvg(int $size = 400, int $margin = 4): string`](#getQRSvg)
* [`getQRText(non-negative-int $margin = 2): string`](#getQRText)

## Methods:
### <a name="isExpired"></a> `isExpired(): bool`

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



### <a name="expiresIn"></a> `expiresIn(): non-negative-int`

Returns the number of seconds until the QR code expires.


#### See also: 
* `non-negative-int`




### <a name="getExpirationCancellation"></a> `getExpirationCancellation(): \Amp\Cancellation`




#### See also: 
* `\Amp\Cancellation`




### <a name="getLoginCancellation"></a> `getLoginCancellation(): \Amp\Cancellation`




#### See also: 
* `\Amp\Cancellation`




### <a name="waitForLoginOrQrCodeExpiration"></a> `waitForLoginOrQrCodeExpiration((\Amp\Cancellation|null) $customCancellation = NULL): ?\danog\MadelineProto\TL\Types\LoginQrCode`

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.  


Parameters:

* `$customCancellation`: `(\Amp\Cancellation|null)` Optional additional cancellation  


#### See also: 
* `\Amp\Cancellation`




### <a name="getQRSvg"></a> `getQRSvg(int $size = 400, int $margin = 4): string`

Render and return SVG version of QR code.


Parameters:

* `$size`: `int`   
* `$margin`: `int`   



### <a name="getQRText"></a> `getQRText(non-negative-int $margin = 2): string`

Render and return plain text version of QR code.


Parameters:

* `$margin`: `non-negative-int` Text margin  


#### See also: 
* `non-negative-int`




---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
