Skip to content

Commit

Permalink
Fixed handling of password var.
Browse files Browse the repository at this point in the history
  • Loading branch information
denpamusic committed Sep 8, 2018
1 parent c384647 commit 16e29bb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ public function __call($method, array $params = [])
*/
protected function defaultConfig(array $config = [])
{
// use same var name as laravel-bitcoinrpc
$config['password'] = isset($config['pass']) ? $config['pass'] : '';

$defaults = [
'scheme' => 'http',
'host' => '127.0.0.1',
Expand All @@ -233,6 +230,15 @@ protected function defaultConfig(array $config = [])
'password' => '',
];

// use same var name as laravel-bitcoinrpc
if (
! array_key_exists('password', $config) &&
array_key_exists('pass', $config)
) {
$config['password'] = $config['pass'];
unset($config['pass']);
}

return array_merge($defaults, $config);
}

Expand Down

0 comments on commit 16e29bb

Please sign in to comment.