Completed
Push — master ( 5a8248...de4c72 )
by Nikolay
03:57
created

SetMethodTrait::setStickerPositionInSet()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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\SetMethodAliasInterface;
9
use TgBotApi\BotApiBase\Method\SetChatDescriptionMethod;
10
use TgBotApi\BotApiBase\Method\SetChatPhotoMethod;
11
use TgBotApi\BotApiBase\Method\SetChatStickerSetMethod;
12
use TgBotApi\BotApiBase\Method\SetChatTitleMethod;
13
use TgBotApi\BotApiBase\Method\SetGameScoreMethod;
14
use TgBotApi\BotApiBase\Method\SetPassportDataErrorsMethod;
15
use TgBotApi\BotApiBase\Method\SetStickerPositionInSetMethod;
16
use TgBotApi\BotApiBase\Method\SetWebhookMethod;
17
18
/**
19
 * Trait SetMethodTrait.
20
 */
21
trait SetMethodTrait
22
{
23
    /**
24
     * @param SetMethodAliasInterface $method
25
     *
26
     * @throws ResponseException
27
     *
28
     * @return bool
29
     */
30
    abstract public function set(SetMethodAliasInterface $method): bool;
31
32
    /**
33
     * @param SetChatDescriptionMethod $method
34
     *
35
     * @throws ResponseException
36
     *
37
     * @return bool
38
     */
39 1
    public function setChatDescription(SetChatDescriptionMethod $method): bool
40
    {
41 1
        return $this->set($method);
42
    }
43
44
    /**
45
     * @param SetChatPhotoMethod $method
46
     *
47
     * @throws ResponseException
48
     *
49
     * @return bool
50
     */
51 1
    public function setChatPhoto(SetChatPhotoMethod $method): bool
52
    {
53 1
        return $this->set($method);
54
    }
55
56
    /**
57
     * @param SetChatStickerSetMethod $method
58
     *
59
     * @throws ResponseException
60
     *
61
     * @return bool
62
     */
63 1
    public function setChatStickerSet(SetChatStickerSetMethod $method): bool
64
    {
65 1
        return $this->set($method);
66
    }
67
68
    /**
69
     * @param SetChatTitleMethod $method
70
     *
71
     * @throws ResponseException
72
     *
73
     * @return bool
74
     */
75 1
    public function setChatTitle(SetChatTitleMethod $method): bool
76
    {
77 1
        return $this->set($method);
78
    }
79
80
    /**
81
     * @param SetGameScoreMethod $method
82
     *
83
     * @throws ResponseException
84
     *
85
     * @return bool
86
     */
87 2
    public function setGameScore(SetGameScoreMethod $method): bool
88
    {
89 2
        return $this->set($method);
90
    }
91
92
    /**
93
     * @param SetStickerPositionInSetMethod $method
94
     *
95
     * @throws ResponseException
96
     *
97
     * @return bool
98
     */
99 1
    public function setStickerPositionInSet(SetStickerPositionInSetMethod $method): bool
100
    {
101 1
        return $this->set($method);
102
    }
103
104
    /**
105
     * @param SetWebhookMethod $method
106
     *
107
     * @throws ResponseException
108
     *
109
     * @return bool
110
     */
111 1
    public function setWebhook(SetWebhookMethod $method): bool
112
    {
113 1
        return $this->set($method);
114
    }
115
116
    /**
117
     * @param SetPassportDataErrorsMethod $method
118
     *
119
     * @throws ResponseException
120
     *
121
     * @return bool
122
     */
123 9
    public function setPassportDataErrors(SetPassportDataErrorsMethod $method): bool
124
    {
125 9
        return $this->set($method);
126
    }
127
}
128