EncryptedPassportElement   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 13
ccs 0
cts 7
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A subEntities() 0 8 1
1
<?php
2
3
/**
4
 * This file is part of the TelegramBot package.
5
 *
6
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Longman\TelegramBot\Entities\TelegramPassport;
13
14
use Longman\TelegramBot\Entities\Entity;
15
16
/**
17
 * Class EncryptedPassportElement
18
 *
19
 * Contains information about documents or other Telegram Passport elements shared with the bot by the user.
20
 *
21
 * @link https://core.telegram.org/bots/api#encryptedpassportelement
22
 *
23
 * @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”.
24
 * @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.
25
 * @method string         getPhoneNumber() Optional. User's verified phone number, available only for “phone_number” type
26
 * @method string         getEmail()       Optional. User's verified email address, available only for “email” type
27
 * @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.
28
 * @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.
29
 * @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.
30
 * @method PassportFile   getSelfie()      Optional. Encrypted file with the selfie of the user holding a 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.
31
 * @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.
32
 * @method string         getHash()        Base64-encoded element hash for using in PassportElementErrorUnspecified
33
 **/
34
class EncryptedPassportElement extends Entity
35
{
36
    /**
37
     * {@inheritdoc}
38
     */
39
    protected function subEntities(): array
40
    {
41
        return [
42
            'files'        => [PassportFile::class],
43
            'front_side'   => PassportFile::class,
44
            'reverse_side' => PassportFile::class,
45
            'selfie'       => PassportFile::class,
46
            'translation'  => [PassportFile::class],
47
        ];
48
    }
49
}
50