EditMethodTrait   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
eloc 6
dl 0
loc 69
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A editMessageText() 0 3 1
A editMessageLiveLocation() 0 3 1
A editMessageReplyMarkup() 0 3 1
A editMessageMedia() 0 3 1
A editMessageCaption() 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\EditMessageCaptionMethod;
9
use TgBotApi\BotApiBase\Method\EditMessageLiveLocationMethod;
10
use TgBotApi\BotApiBase\Method\EditMessageMediaMethod;
11
use TgBotApi\BotApiBase\Method\EditMessageReplyMarkupMethod;
12
use TgBotApi\BotApiBase\Method\EditMessageTextMethod;
13
use TgBotApi\BotApiBase\Method\Interfaces\EditMethodAliasInterface;
14
use TgBotApi\BotApiBase\Type\MessageType;
15
16
/**
17
 * Trait EditMethodTrait.
18
 */
19
trait EditMethodTrait
20
{
21
    /**
22
     * @param EditMethodAliasInterface $method
23
     *
24
     * @throws ResponseException
25
     *
26
     * @return MessageType | bool
27
     */
28
    abstract public function edit(EditMethodAliasInterface $method);
29
30
    /**
31
     * @param EditMessageCaptionMethod $method
32
     *
33
     * @throws ResponseException
34
     *
35
     * @return MessageType | bool
36
     */
37 2
    public function editMessageCaption(EditMessageCaptionMethod $method)
38
    {
39 2
        return $this->edit($method);
40
    }
41
42
    /**
43
     * @param EditMessageLiveLocationMethod $method
44
     *
45
     * @throws ResponseException
46
     *
47
     * @return MessageType | bool
48
     */
49 2
    public function editMessageLiveLocation(EditMessageLiveLocationMethod $method)
50
    {
51 2
        return $this->edit($method);
52
    }
53
54
    /**
55
     * @param EditMessageMediaMethod $method
56
     *
57
     * @throws ResponseException
58
     *
59
     * @return MessageType | bool
60
     */
61 4
    public function editMessageMedia(EditMessageMediaMethod $method)
62
    {
63 4
        return $this->edit($method);
64
    }
65
66
    /**
67
     * @param EditMessageReplyMarkupMethod $method
68
     *
69
     * @throws ResponseException
70
     *
71
     * @return MessageType | bool
72
     */
73 2
    public function editMessageReplyMarkup(EditMessageReplyMarkupMethod $method)
74
    {
75 2
        return $this->edit($method);
76
    }
77
78
    /**
79
     * @param EditMessageTextMethod $method
80
     *
81
     * @throws ResponseException
82
     *
83
     * @return MessageType | bool
84
     */
85 2
    public function editMessageText(EditMessageTextMethod $method)
86
    {
87 2
        return $this->edit($method);
88
    }
89
}
90