Passed
Pull Request — master (#767)
by thomas
28:03
created

NetworkFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 4
dl 0
loc 27
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A bitcoinRegtest() 0 3 1
A bitcoin() 0 3 1
A bitcoinTestnet() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BitWasp\Bitcoin\Network;
6
7
class NetworkFactory
8
{
9
    /**
10
     * @return NetworkInterface
11
     * @throws \Exception
12
     */
13 85
    public static function bitcoin(): NetworkInterface
14
    {
15 85
        return new Networks\Bitcoin();
16
    }
17
18
    /**
19
     * @return NetworkInterface
20
     * @throws \Exception
21
     */
22 11
    public static function bitcoinTestnet(): NetworkInterface
23
    {
24 11
        return new Networks\BitcoinTestnet();
25
    }
26
27
    /**
28
     * @return NetworkInterface
29
     * @throws \Exception
30
     */
31 2
    public static function bitcoinRegtest(): NetworkInterface
32
    {
33 2
        return new Networks\BitcoinRegtest();
34
    }
35
}
36