@@ -97,8 +97,9 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | public function CreateAddress($label = null){ |
| 99 | 99 | $params = array(); |
| 100 | - if(!is_null($label)) |
|
| 101 | - $params = ['label'=>$label]; |
|
| 100 | + if(!is_null($label)) { |
|
| 101 | + $params = ['label'=>$label]; |
|
| 102 | + } |
|
| 102 | 103 | $response = $this->call('accounts/create',$params); |
| 103 | 104 | return new WalletAddress($response); |
| 104 | 105 | } |
@@ -135,9 +136,10 @@ discard block |
||
| 135 | 136 | public function ActiveAddresses() { |
| 136 | 137 | $addresses = $this->call('accounts',$this->reqParams()); |
| 137 | 138 | $response = array(); |
| 138 | - if(!empty($addresses)) |
|
| 139 | - foreach ($addresses as $address){ |
|
| 139 | + if(!empty($addresses)) { |
|
| 140 | + foreach ($addresses as $address){ |
|
| 140 | 141 | $response[] = new AccountResponse($address); |
| 142 | + } |
|
| 141 | 143 | } |
| 142 | 144 | return $response; |
| 143 | 145 | } |
@@ -214,19 +216,23 @@ discard block |
||
| 214 | 216 | */ |
| 215 | 217 | |
| 216 | 218 | public function SendPayment($to, $amount, $from=null, $fee=null, $fee_per_byte=null){ |
| 217 | - if(!isset($amount)) |
|
| 218 | - throw new ParameterError("Amount required."); |
|
| 219 | + if(!isset($amount)) { |
|
| 220 | + throw new ParameterError("Amount required."); |
|
| 221 | + } |
|
| 219 | 222 | |
| 220 | 223 | $params = array( |
| 221 | 224 | 'to'=>$to, |
| 222 | 225 | 'amount'=>$amount |
| 223 | 226 | ); |
| 224 | - if(!is_null($from)) |
|
| 225 | - $params['from'] = $from; |
|
| 226 | - if(!is_null($fee)) |
|
| 227 | - $params['fee'] = $fee; |
|
| 228 | - if(!is_null($fee_per_byte)) |
|
| 229 | - $params['fee_per_byte'] = $fee_per_byte; |
|
| 227 | + if(!is_null($from)) { |
|
| 228 | + $params['from'] = $from; |
|
| 229 | + } |
|
| 230 | + if(!is_null($fee)) { |
|
| 231 | + $params['fee'] = $fee; |
|
| 232 | + } |
|
| 233 | + if(!is_null($fee_per_byte)) { |
|
| 234 | + $params['fee_per_byte'] = $fee_per_byte; |
|
| 235 | + } |
|
| 230 | 236 | $response = $this->call('payment',$params); |
| 231 | 237 | return new PaymentResponse($response); |
| 232 | 238 | } |
@@ -244,12 +250,15 @@ discard block |
||
| 244 | 250 | $params = array( |
| 245 | 251 | 'recipients'=>json_encode($recipients) |
| 246 | 252 | ); |
| 247 | - if(!is_null($from)) |
|
| 248 | - $params['from'] = $from; |
|
| 249 | - if(!is_null($fee)) |
|
| 250 | - $params['fee'] = $fee; |
|
| 251 | - if(!is_null($fee_per_byte)) |
|
| 252 | - $params['fee_per_byte'] = $fee_per_byte; |
|
| 253 | + if(!is_null($from)) { |
|
| 254 | + $params['from'] = $from; |
|
| 255 | + } |
|
| 256 | + if(!is_null($fee)) { |
|
| 257 | + $params['fee'] = $fee; |
|
| 258 | + } |
|
| 259 | + if(!is_null($fee_per_byte)) { |
|
| 260 | + $params['fee_per_byte'] = $fee_per_byte; |
|
| 261 | + } |
|
| 253 | 262 | $response = $this->call('sendmany',$params); |
| 254 | 263 | return new PaymentResponse($response); |
| 255 | 264 | } |