EncryptedPassportElement   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 7
dl 0
loc 14
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A subEntities() 0 8 1
1
<?php
2
3
namespace TelegramBot\Entities\TelegramPassport;
4
5
use TelegramBot\Entity;
6
7
/**
8
 * Class EncryptedPassportElement
9
 *
10
 * Contains information about documents or other Telegram Passport elements shared with the bot by the user.
11
 *
12
 * @link https://core.telegram.org/bots/api#encryptedpassportelement
13
 *
14
 * @method string         getType()         Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.
15
 * @method string         getData()         Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “identity_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials.
16
 * @method string         getPhoneNumber()  Optional. User's verified phone number, available only for “phone_number” type
17
 * @method string         getEmail()        Optional. User's verified email address, available only for “email” type
18
 * @method PassportFile[] getFiles()        Optional. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
19
 * @method PassportFile   getFrontSide()    Optional. Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
20
 * @method PassportFile   getReverseSide()  Optional. Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
21
 * @method PassportFile   getSelfie()       Optional. Encrypted file with the selfie of the user holding a document, provided by the user;
22
 * available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
23
 * @method PassportFile[] getTranslation()  Optional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
24
 * @method string         getHash()         Base64-encoded element hash for using in PassportElementErrorUnspecified
25
 **/
26
class EncryptedPassportElement extends Entity
27
{
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    protected function subEntities(): array
33
    {
34
        return [
35
            'files' => [PassportFile::class],
36
            'front_side' => PassportFile::class,
37
            'reverse_side' => PassportFile::class,
38
            'selfie' => PassportFile::class,
39
            'translation' => [PassportFile::class],
40
        ];
41
    }
42
43
}
44