| Total Complexity | 7 |
| Total Lines | 79 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class GetPassportAuthorizationForm extends TdFunction |
||
| 15 | { |
||
| 16 | public const TYPE_NAME = 'getPassportAuthorizationForm'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * User identifier of the service's bot. |
||
| 20 | * |
||
| 21 | * @var int |
||
| 22 | */ |
||
| 23 | protected int $botUserId; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Telegram Passport element types requested by the service. |
||
| 27 | * |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | protected string $scope; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Service's public_key. |
||
| 34 | * |
||
| 35 | * @var string |
||
| 36 | */ |
||
| 37 | protected string $publicKey; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Authorization form nonce provided by the service. |
||
| 41 | * |
||
| 42 | * @var string |
||
| 43 | */ |
||
| 44 | protected string $nonce; |
||
| 45 | |||
| 46 | public function __construct(int $botUserId, string $scope, string $publicKey, string $nonce) |
||
| 47 | { |
||
| 48 | $this->botUserId = $botUserId; |
||
| 49 | $this->scope = $scope; |
||
| 50 | $this->publicKey = $publicKey; |
||
| 51 | $this->nonce = $nonce; |
||
| 52 | } |
||
| 53 | |||
| 54 | public static function fromArray(array $array): GetPassportAuthorizationForm |
||
| 55 | { |
||
| 56 | return new static( |
||
| 57 | $array['bot_user_id'], |
||
| 58 | $array['scope'], |
||
| 59 | $array['public_key'], |
||
| 60 | $array['nonce'], |
||
| 61 | ); |
||
| 62 | } |
||
| 63 | |||
| 64 | public function typeSerialize(): array |
||
| 72 | ]; |
||
| 73 | } |
||
| 74 | |||
| 75 | public function getBotUserId(): int |
||
| 76 | { |
||
| 77 | return $this->botUserId; |
||
| 78 | } |
||
| 79 | |||
| 80 | public function getScope(): string |
||
| 83 | } |
||
| 84 | |||
| 85 | public function getPublicKey(): string |
||
| 86 | { |
||
| 87 | return $this->publicKey; |
||
| 88 | } |
||
| 89 | |||
| 90 | public function getNonce(): string |
||
| 93 | } |
||
| 94 | } |
||
| 95 |