Passed
Pull Request — master (#44)
by Nikolay
15:17
created

UnpinMethodTrait::unpinAllChatMessage()   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\UnpinMethodAliasInterface;
9
use TgBotApi\BotApiBase\Method\UnpinAllChatMessageMethod;
10
use TgBotApi\BotApiBase\Method\UnpinChatMessageMethod;
11
12
/**
13
 * Trait UbpinMethodTrait.
14
 */
15
trait UnpinMethodTrait
16
{
17
    /**
18
     * @throws ResponseException
19
     */
20
    abstract public function unpin(UnpinMethodAliasInterface $method): bool;
21
22
    /**
23
     * @throws ResponseException
24
     */
25 2
    public function unpinChatMessage(UnpinChatMessageMethod $method): bool
26
    {
27 2
        return $this->unpin($method);
28
    }
29
30
    /**
31
     * @throws ResponseException
32
     */
33 1
    public function unpinAllChatMessage(UnpinAllChatMessageMethod $method): bool
34
    {
35 1
        return $this->unpin($method);
36
    }
37
}
38