Passed
Push — master ( c05883...1d5c29 )
by Nikolay
02:30
created

UploadStickerFileMethod   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
eloc 7
dl 0
loc 30
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace TgBotApi\BotApiBase\Method;
6
7
use TgBotApi\BotApiBase\Type\InputFileType;
8
9
/**
10
 * Class UploadStickerFileMethod.
11
 *
12
 * Use this method to upload a .png file with a sticker for later use in createNewStickerSet
13
 * and addStickerToSet methods (can be used multiple times). Returns the uploaded File on success.
14
 *
15
 * @see https://core.telegram.org/bots/api#uploadstickerfile
16
 */
17
class UploadStickerFileMethod
18
{
19
    /**
20
     * User identifier of sticker file owner.
21
     *
22
     * @var int
23
     */
24
    public $userId;
25
26
    /**
27
     * Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px,
28
     * and either width or height must be exactly 512px.
29
     *
30
     * @var InputFileType
31
     */
32
    public $pngSticker;
33
34
    /**
35
     * @param int           $userId
36
     * @param InputFileType $pngSticker
37
     *
38
     * @return UploadStickerFileMethod
39
     */
40
    public static function create(int $userId, InputFileType $pngSticker): UploadStickerFileMethod
41
    {
42
        $instance = new static();
43
        $instance->userId = $userId;
44
        $instance->pngSticker = $pngSticker;
45
46
        return $instance;
47
    }
48
}
49