bitcoind-php
bitcoind-php copied to clipboard
safe lines of code
Is there a way to safe some lines of code? As example:
$command = new \Nbobtc\Command\Command;
$client = new \Nbobtc\Http\Client('http://***:***@localhost:18332');
$command = new $command('validateaddress', $request->input('address'));
$response = $client->sendCommand($command);
$contents = json_decode($response->getBody()->getContents());
if($contents->result->isvalid) {
$command = new $command('getnewaddress', 'foo');
$response = $client->sendCommand($command);
$contents = json_decode($response->getBody()->getContents());
print_r($response);
}
so is there a shorter way to get the result?