Passed
Pull Request — develop (#1492)
by Rabie
07:07
created

StarTransaction::subEntities()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Longman\TelegramBot\Entities;
4
5
use Longman\TelegramBot\Entities\User;
6
7
/**
8
 * Class StarTransaction
9
 *
10
 * Describes a Telegram Star transaction.
11
 *
12
 * @link https://core.telegram.org/bots/api#startransaction
13
 *
14
 * @method string getId() Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions.
15
 * @method int getAmount() Number of Telegram Stars transferred by the transaction
16
 * @method int getDate() Date the transaction was created in Unix time
17
 * @method User getSource() Optional. Source of the transaction. Can be a user, a bot, or an app. Null for refund transactions.
18
 * @method User getReceiver() Optional. Receiver of the transaction. Can be a user, a bot, or an app. Null for refund transactions.
19
 *
20
 * @method $this setId(string $id) Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions.
21
 * @method $this setAmount(int $amount) Number of Telegram Stars transferred by the transaction
22
 * @method $this setDate(int $date) Date the transaction was created in Unix time
23
 * @method $this setSource(User $source) Optional. Source of the transaction. Can be a user, a bot, or an app. Null for refund transactions.
24
 * @method $this setReceiver(User $receiver) Optional. Receiver of the transaction. Can be a user, a bot, or an app. Null for refund transactions.
25
 */
26
class StarTransaction extends Entity
27
{
28
    protected function subEntities(): array
29
    {
30
        return [
31
            'source'   => User::class,
32
            'receiver' => User::class,
33
        ];
34
    }
35
}
36