Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

safe lines of code #23

Open
SimonVillage opened this issue Aug 31, 2016 · 0 comments
Open

safe lines of code #23

SimonVillage opened this issue Aug 31, 2016 · 0 comments

Comments

@SimonVillage
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant