Code Duplication    Length = 21-21 lines in 2 locations

src/BlocktrailSDK.php 1 location

@@ 83-103 (lines=21) @@
80
     * @return array
81
     * @throws \Exception
82
     */
83
    protected function normalizeNetwork($network, $testnet) {
84
        switch (strtolower($network)) {
85
            case 'btc':
86
            case 'bitcoin':
87
                $network = 'bitcoin';
88
89
                break;
90
91
            case 'tbtc':
92
            case 'bitcoin-testnet':
93
                $network = 'bitcoin';
94
                $testnet = true;
95
96
                break;
97
98
            default:
99
                throw new \Exception("Unknown network [{$network}]");
100
        }
101
102
        return [$network, $testnet];
103
    }
104
105
    /**
106
     * set BitcoinLib to the correct magic-byte defaults for the selected network

src/WalletSweeper.php 1 location

@@ 125-145 (lines=21) @@
122
     * @return array
123
     * @throws \Exception
124
     */
125
    protected function normalizeNetwork($network, $testnet) {
126
        switch (strtolower($network)) {
127
            case 'btc':
128
            case 'bitcoin':
129
                $network = 'bitcoin';
130
131
                break;
132
133
            case 'tbtc':
134
            case 'bitcoin-testnet':
135
                $network = 'bitcoin';
136
                $testnet = true;
137
138
                break;
139
140
            default:
141
                throw new \Exception("Unknown network [{$network}]");
142
        }
143
144
        return [$network, $testnet];
145
    }
146
147
148
    /**