Base58Address   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAddress() 0 5 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BitWasp\Bitcoin\Address;
6
7
use BitWasp\Bitcoin\Base58;
8
use BitWasp\Bitcoin\Bitcoin;
9
use BitWasp\Bitcoin\Network\NetworkInterface;
10
use BitWasp\Buffertools\Buffer;
11
12
abstract class Base58Address extends Address implements Base58AddressInterface
13
{
14
    /**
15
     * @param NetworkInterface|null $network
16
     * @return string
17
     */
18 45
    public function getAddress(NetworkInterface $network = null): string
19
    {
20 45
        $network = $network ?: Bitcoin::getNetwork();
21 45
        $payload = new Buffer($this->getPrefixByte($network) . $this->getHash()->getBinary());
22 45
        return Base58::encodeCheck($payload);
23
    }
24
}
25