Completed
Push — master ( 226900...81ddff )
by thomas
18:25
created

NetworkFactory   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 101
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 12

Test Coverage

Coverage 91.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 101
ccs 22
cts 24
cp 0.9167
rs 10
c 1
b 0
f 0
wmc 12
lcom 0
cbo 12

12 Methods

Rating   Name   Duplication   Size   Complexity  
A bitcoin() 0 4 1
A bitcoinTestnet() 0 4 1
A bitcoinRegtest() 0 4 1
A litecoin() 0 4 1
A litecoinTestnet() 0 4 1
A viacoin() 0 4 1
A viacoinTestnet() 0 4 1
A dogecoin() 0 4 1
A dogecoinTestnet() 0 4 1
A dash() 0 4 1
A dashTestnet() 0 4 1
A zcash() 0 4 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 91
    public static function bitcoin(): NetworkInterface
14
    {
15 91
        return new Networks\Bitcoin();
16
    }
17
18
    /**
19
     * @return NetworkInterface
20
     * @throws \Exception
21
     */
22 22
    public static function bitcoinTestnet(): NetworkInterface
23
    {
24 22
        return new Networks\BitcoinTestnet();
25
    }
26
27
    /**
28
     * @return NetworkInterface
29
     * @throws \Exception
30
     */
31 1
    public static function bitcoinRegtest(): NetworkInterface
32
    {
33 1
        return new Networks\BitcoinRegtest();
34
    }
35
36
    /**
37
     * @return NetworkInterface
38
     */
39 3
    public static function litecoin(): NetworkInterface
40
    {
41 3
        return new Networks\Litecoin();
42
    }
43
44
    /**
45
     * @return Networks\LitecoinTestnet
46
     */
47 1
    public static function litecoinTestnet(): NetworkInterface
48
    {
49 1
        return new Networks\LitecoinTestnet();
50
    }
51
52
    /**
53
     * @return Networks\Viacoin
54
     */
55 3
    public static function viacoin(): NetworkInterface
56
    {
57 3
        return new Networks\Viacoin();
58
    }
59
60
    /**
61
     * @return Networks\ViacoinTestnet
62
     */
63 2
    public static function viacoinTestnet(): NetworkInterface
64
    {
65 2
        return new Networks\ViacoinTestnet();
66
    }
67
68
    /**
69
     * @return Networks\Dogecoin
70
     */
71 2
    public static function dogecoin(): NetworkInterface
72
    {
73 2
        return new Networks\Dogecoin();
74
    }
75
76
    /**
77
     * @return Networks\DogecoinTestnet
78
     */
79 2
    public static function dogecoinTestnet(): NetworkInterface
80
    {
81 2
        return new Networks\DogecoinTestnet();
82
    }
83
84
    /**
85
     * @return Networks\Dash
86
     */
87 2
    public static function dash(): NetworkInterface
88
    {
89 2
        return new Networks\Dash();
90
    }
91
92
    /**
93
     * @return Networks\DashTestnet
94
     */
95 2
    public static function dashTestnet(): NetworkInterface
96
    {
97 2
        return new Networks\DashTestnet();
98
    }
99
100
    /**
101
     * @return NetworkInterface
102
     */
103
    public static function zcash()
104
    {
105
        return new Networks\Zcash();
106
    }
107
}
108