Passed
Push — master ( 45bce2...5a8248 )
by Nikolay
03:20
created

ForwardMethodTrait::forwardMessage()   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\Helper;
6
7
use TgBotApi\BotApiBase\Exception\NormalizationException;
8
use TgBotApi\BotApiBase\Exception\ResponseException;
9
use TgBotApi\BotApiBase\Method\ForwardMessageMethod;
10
use TgBotApi\BotApiBase\Type\MessageType;
11
12
/**
13
 * Trait ForwardMethodTrait.
14
 */
15
trait ForwardMethodTrait
16
{
17
    /**
18
     * @param $method
19
     * @param $type
20
     *
21
     * @throws ResponseException
22
     * @throws NormalizationException
23
     *
24
     * @return mixed
25
     */
26
    abstract public function call($method, $type = null);
27
28
    /**
29
     * @param ForwardMessageMethod $method
30
     *
31
     * @throws NormalizationException
32
     * @throws ResponseException
33
     *
34
     * @return MessageType
35
     */
36 3
    public function forwardMessage(ForwardMessageMethod $method): MessageType
37
    {
38 3
        return $this->call($method, MessageType::class);
39
    }
40
}
41