Passed
Push — master ( 45bce2...5a8248 )
by Nikolay
03:20
created

UploadMethodTrait::uploadStickerFile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace TgBotApi\BotApiBase\Helper;
6
7
use TgBotApi\BotApiBase\Exception\NormalizationException;
8
use TgBotApi\BotApiBase\Exception\ResponseException;
9
use TgBotApi\BotApiBase\Method\UploadStickerFileMethod;
10
use TgBotApi\BotApiBase\Type\FileType;
11
12
/**
13
 * Trait UploadMethodTrait.
14
 */
15
trait UploadMethodTrait
16
{
17
    /**
18
     * @param $method
19
     * @param $type
20
     *
21
     * @throws ResponseException
22
     * @throws NormalizationException
23
     *
24
     * @return mixed
25
     */
26
    abstract public function call($method, $type = null);
27
28
    /**
29
     * @param UploadStickerFileMethod $method
30
     *
31
     * @throws NormalizationException
32
     * @throws ResponseException
33
     *
34
     * @return FileType
35
     */
36
    public function uploadStickerFile(UploadStickerFileMethod $method): FileType
37
    {
38
        return $this->call($method, FileType::class);
39
    }
40
}
41