Failed Conditions
Pull Request — master (#12)
by thomas
03:33
created

MessageBase::getProto()   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
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BitWasp\Trezor\Device;
6
7
use BitWasp\TrezorProto\MessageType;
8
9
abstract class MessageBase
10
{
11
    /**
12
     * @var MessageType
13
     */
14
    private $type;
15
16
    /**
17
     * @var \Protobuf\Message
18
     */
19
    private $proto;
20
21 43
    public function __construct(
22
        MessageType $messageType,
23
        \Protobuf\Message $protobuf
24
    ) {
25 43
        $this->type = $messageType;
26 43
        $this->proto = $protobuf;
27 43
    }
28
29 42
    public function getType(): int
30
    {
31 42
        return $this->type->value();
32
    }
33
34 42
    public function getProto(): \Protobuf\Message
35
    {
36 42
        return $this->proto;
37
    }
38
}
39