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

DeleteMethodTrait::deleteChatStickerSet()   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\DeleteChatPhotoMethod;
9
use TgBotApi\BotApiBase\Method\DeleteChatStickerSetMethod;
10
use TgBotApi\BotApiBase\Method\DeleteMessageMethod;
11
use TgBotApi\BotApiBase\Method\DeleteStickerFromSetMethod;
12
use TgBotApi\BotApiBase\Method\DeleteWebhookMethod;
13
use TgBotApi\BotApiBase\Method\Interfaces\DeleteMethodAliasInterface;
14
15
/**
16
 * Trait DeleteMethodTrait.
17
 */
18
trait DeleteMethodTrait
19
{
20
    /**
21
     * @param DeleteMethodAliasInterface $method
22
     *
23
     * @throws ResponseException
24
     *
25
     * @return bool
26
     */
27
    abstract public function delete(DeleteMethodAliasInterface $method): bool;
28
29
    /**
30
     * @param DeleteChatPhotoMethod $method
31
     *
32
     * @throws ResponseException
33
     *
34
     * @return bool
35
     */
36 1
    public function deleteChatPhoto(DeleteChatPhotoMethod $method): bool
37
    {
38 1
        return $this->delete($method);
39
    }
40
41
    /**
42
     * @param DeleteChatStickerSetMethod $method
43
     *
44
     * @throws ResponseException
45
     *
46
     * @return bool
47
     */
48 1
    public function deleteChatStickerSet(DeleteChatStickerSetMethod $method): bool
49
    {
50 1
        return $this->delete($method);
51
    }
52
53
    /**
54
     * @param DeleteMessageMethod $method
55
     *
56
     * @throws ResponseException
57
     *
58
     * @return bool
59
     */
60 1
    public function deleteMessage(DeleteMessageMethod $method): bool
61
    {
62 1
        return $this->delete($method);
63
    }
64
65
    /**
66
     * @param DeleteStickerFromSetMethod $method
67
     *
68
     * @throws ResponseException
69
     *
70
     * @return bool
71
     */
72 1
    public function deleteStickerFromSet(DeleteStickerFromSetMethod $method): bool
73
    {
74 1
        return $this->delete($method);
75
    }
76
77
    /**
78
     * @param DeleteWebhookMethod $method
79
     *
80
     * @throws ResponseException
81
     *
82
     * @return bool
83
     */
84 1
    public function deleteWebhook(DeleteWebhookMethod $method): bool
85
    {
86 1
        return $this->delete($method);
87
    }
88
}
89