Skip to content

Commit

Permalink
Reformat SmsIRClient.php + Remove typed properties because of php 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
amirbagh75 committed Oct 21, 2020
1 parent 6a52b55 commit 254a537
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/SmsIRClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

class SmsIRClient
{
private string $userApiKey;
private string $secretKey;
private string $token;
private string $lineNumber;
private Client $client;
private $userApiKey;
private $secretKey;
private $token;
private $lineNumber;
private $client;

/**
* Create a new HesabfaClient Instance
Expand Down Expand Up @@ -45,7 +45,7 @@ public function __construct(string $userApiKey, string $secretKey, string $lineN
public function smsCredit(): float
{
$result = $this->executeRequest('credit');
return (float)json_decode($result->getBody()->getContents(), true)['Credit'];
return (float) json_decode($result->getBody()->getContents(), true)['Credit'];
}

/**
Expand Down Expand Up @@ -153,22 +153,20 @@ public function sendVerificationCode(string $code, string $mobileNumber): array
*/
public function ultraFastSend(array $parameters, string $templateId, string $mobileNumber): array
{
if(count($parameters) == 0){
if (count($parameters) == 0) {
die("please fill parameters for ultraFastSend\n");
}

$params = [];
foreach ($parameters as $key => $value) {
$params[] = ['Parameter' => $key, 'ParameterValue' => $value];
}
$body = [
$body = [
'ParameterArray' => $params,
'TemplateId' => $templateId,
'Mobile' => $mobileNumber
];
$result = $this->executeRequest('UltraFastSend', $body);
return json_decode($result->getBody()->getContents(),true);
return json_decode($result->getBody()->getContents(), true);
}


}

0 comments on commit 254a537

Please sign in to comment.