Total Complexity | 7 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | trait CreateKeypairTrait |
||
8 | { |
||
9 | public function validateAndLoadConfig() |
||
10 | { |
||
11 | $config = config('laravel-bitpay'); |
||
|
|||
12 | |||
13 | if ('livenet' != $config['network'] && 'testnet' != $config['network']) { |
||
14 | throw InvalidConfigurationException::invalidNetworkName(); |
||
15 | } |
||
16 | |||
17 | if (!class_exists($config['key_storage'])) { |
||
18 | throw InvalidConfigurationException::invalidStorageClass(); |
||
19 | } |
||
20 | |||
21 | if ('' === trim($config['key_storage_password'])) { |
||
22 | throw InvalidConfigurationException::invalidOrEmptyPassword(); |
||
23 | } |
||
24 | |||
25 | $this->config = $config; |
||
26 | } |
||
27 | |||
28 | protected function writeNewEnvironmentFileWith() |
||
34 | )); |
||
35 | } |
||
36 | |||
37 | protected function keyReplacementPattern() |
||
44 |