Completed
Pull Request — master (#12)
by thomas
19:02 queued 01:07
created

DebugMessage::memoryRead()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BitWasp\Trezor\Device;
6
7
use BitWasp\TrezorProto\DebugLinkDecision;
8
use BitWasp\TrezorProto\DebugLinkGetState;
9
use BitWasp\TrezorProto\DebugLinkMemoryRead;
10
use BitWasp\TrezorProto\DebugLinkStop;
11
use BitWasp\TrezorProto\MessageType;
12
13
class DebugMessage extends MessageBase
14
{
15
    public static function getState(DebugLinkGetState $getState): self
16
    {
17
        return new self(
18
            MessageType::MessageType_DebugLinkGetState(),
19
            $getState
20
        );
21
    }
22
    public static function stop(DebugLinkStop $stop)
23
    {
24
        return new self(
25
            MessageType::MessageType_DebugLinkStop(),
26
            $stop
27
        );
28
    }
29
    public static function decision(DebugLinkDecision $decision)
30
    {
31
        return new self(
32
            MessageType::MessageType_DebugLinkDecision(),
33
            $decision
34
        );
35
    }
36
37
    public static function memoryRead(DebugLinkMemoryRead $memoryRead): self
38
    {
39
        return new self(
40
            MessageType::MessageType_DebugLinkMemoryRead(),
41
            $memoryRead
42
        );
43
    }
44
}
45