NetworkSerializable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 11
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getNetworkMessage() 0 5 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BitWasp\Bitcoin\Networking;
6
7
use BitWasp\Bitcoin\Bitcoin;
8
use BitWasp\Bitcoin\Network\NetworkInterface;
9
use BitWasp\Bitcoin\Serializable;
10
11
abstract class NetworkSerializable extends Serializable implements NetworkSerializableInterface
12
{
13
    /**
14
     * @param NetworkInterface $network
15 93
     * @return NetworkMessage
16
     */
17 93
    public function getNetworkMessage(NetworkInterface $network = null): NetworkMessage
18 93
    {
19
        return new NetworkMessage(
20 62
            $network ?: Bitcoin::getNetwork(),
21
            $this
22
        );
23
    }
24
}
25