Passed
Push — master ( 96ab76...3ce77f )
by Nikolay
01:27 queued 10s
created

SetMethodTrait::setChatPhoto()   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\SetChatAdministratorCustomTitleMethod;
10
use TgBotApi\BotApiBase\Method\SetChatDescriptionMethod;
11
use TgBotApi\BotApiBase\Method\SetChatPermissionsMethod;
12
use TgBotApi\BotApiBase\Method\SetChatPhotoMethod;
13
use TgBotApi\BotApiBase\Method\SetChatStickerSetMethod;
14
use TgBotApi\BotApiBase\Method\SetChatTitleMethod;
15
use TgBotApi\BotApiBase\Method\SetGameScoreMethod;
16
use TgBotApi\BotApiBase\Method\SetPassportDataErrorsMethod;
17
use TgBotApi\BotApiBase\Method\SetStickerPositionInSetMethod;
18
use TgBotApi\BotApiBase\Method\SetWebhookMethod;
19
20
/**
21
 * Trait SetMethodTrait.
22
 */
23
trait SetMethodTrait
24
{
25
    /**
26
     * @throws ResponseException
27
     */
28
    abstract public function set(SetMethodAliasInterface $method): bool;
29
30
    /**
31
     * @throws ResponseException
32
     */
33 1
    public function setChatDescription(SetChatDescriptionMethod $method): bool
34
    {
35 1
        return $this->set($method);
36
    }
37
38
    /**
39
     * @throws ResponseException
40
     */
41 1
    public function setChatPhoto(SetChatPhotoMethod $method): bool
42
    {
43 1
        return $this->set($method);
44
    }
45
46
    /**
47
     * @throws ResponseException
48
     */
49 1
    public function setChatAdministratorCustomTitle(SetChatAdministratorCustomTitleMethod $method): bool
50
    {
51 1
        return $this->set($method);
52
    }
53
54
    /**
55
     * @throws ResponseException
56
     */
57 1
    public function setChatStickerSet(SetChatStickerSetMethod $method): bool
58
    {
59 1
        return $this->set($method);
60
    }
61
62
    /**
63
     * @throws ResponseException
64
     */
65 1
    public function setChatTitle(SetChatTitleMethod $method): bool
66
    {
67 1
        return $this->set($method);
68
    }
69
70
    /**
71
     * @throws ResponseException
72
     */
73 2
    public function setGameScore(SetGameScoreMethod $method): bool
74
    {
75 2
        return $this->set($method);
76
    }
77
78
    /**
79
     * @throws ResponseException
80
     */
81 1
    public function setStickerPositionInSet(SetStickerPositionInSetMethod $method): bool
82
    {
83 1
        return $this->set($method);
84
    }
85
86
    /**
87
     * @throws ResponseException
88
     */
89 1
    public function setWebhook(SetWebhookMethod $method): bool
90
    {
91 1
        return $this->set($method);
92
    }
93
94
    /**
95
     * @throws ResponseException
96
     */
97 9
    public function setPassportDataErrors(SetPassportDataErrorsMethod $method): bool
98
    {
99 9
        return $this->set($method);
100
    }
101
102
    /**
103
     * @throws ResponseException
104
     */
105 1
    public function setChatPermissions(SetChatPermissionsMethod $method): bool
106
    {
107 1
        return $this->set($method);
108
    }
109
}
110