Completed
Push — master ( aedb8a...d04b6a )
by Nikolay
05:04
created

UploadMethodTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 2
dl 0
loc 21
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A uploadStickerFile() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace TgBotApi\BotApiBase\Traits;
6
7
use TgBotApi\BotApiBase\Exception\ResponseException;
8
use TgBotApi\BotApiBase\Method\Interfaces\UploadMethodAliasInterface;
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 UploadMethodAliasInterface $method
19
     *
20
     * @throws ResponseException
21
     *
22
     * @return FileType
23
     */
24
    abstract public function upload(UploadMethodAliasInterface $method): FileType;
25
26
    /**
27
     * @param UploadStickerFileMethod $method
28
     *
29
     * @throws ResponseException
30
     *
31
     * @return FileType
32
     */
33 1
    public function uploadStickerFile(UploadStickerFileMethod $method): FileType
34
    {
35 1
        return $this->upload($method);
36
    }
37
}
38