Completed
Push — master ( d04b6a...4e4c0e )
by Nikolay
03:14
created

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