Passed
Branch Helper (0d23ed)
by Nikolay
05:59
created

CreateMethodTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createNewStickerSet() 0 3 1
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\CreateNewStickerSetMethod;
10
11
/**
12
 * Trait CreateMethodTrait.
13
 */
14
trait CreateMethodTrait
15
{
16
    /**
17
     * @param $method
18
     * @param $type
19
     *
20
     * @throws ResponseException
21
     * @throws NormalizationException
22
     *
23
     * @return mixed
24
     */
25
    abstract public function call($method, $type = null);
26
27
    /**
28
     * @param CreateNewStickerSetMethod $method
29
     *
30
     * @throws NormalizationException
31
     * @throws ResponseException
32
     *
33
     * @return bool
34
     */
35
    public function createNewStickerSet(CreateNewStickerSetMethod $method): bool
36
    {
37
        return $this->call($method);
38
    }
39
}
40