Skip to content

Commit

Permalink
Merge pull request #19 from gomax/master
Browse files Browse the repository at this point in the history
Fix some notices
  • Loading branch information
zelenin committed Mar 29, 2015
2 parents 99cb2d9 + b2b0700 commit d8fbb8e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Smsru.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public function multiSmsSend(
$test = false,
$partner_id = null
) {
$params = [];
foreach ($messages as $message) {
$params['multi'][$message[0]] = $message[1];
}
Expand Down Expand Up @@ -150,8 +151,8 @@ public function smsCost($to, $text)
return [
'code' => $result[0],
'description' => $this->getAnswer(static::METHOD_SMS_COST, $result[0]),
'price' => $result[1],
'number' => $result[2]
'price' => array_key_exists(1, $result) ? $result[1] : null,
'number' => array_key_exists(2, $result) ? $result[2] : null
];
}

Expand All @@ -162,7 +163,7 @@ public function myBalance()
return [
'code' => $result[0],
'description' => $this->getAnswer(static::METHOD_MY_BALANCE, $result[0]),
'balance' => $result[1]
'balance' => array_key_exists(1, $result) ? $result[1] : null
];
}

Expand All @@ -173,8 +174,8 @@ public function myLimit()
return [
'code' => $result[0],
'description' => $this->getAnswer(static::METHOD_MY_LIMIT, $result[0]),
'total' => $result[1],
'current' => $result[2]
'total' => array_key_exists(1, $result) ? $result[1] : null,
'current' => array_key_exists(2, $result) ? $result[2] : null
];
}

Expand Down

0 comments on commit d8fbb8e

Please sign in to comment.