@@ -61,7 +61,7 @@ class SmsApi
61
61
*/
62
62
private $ account = null ;
63
63
64
- /**
64
+ /**
65
65
* User
66
66
*
67
67
* @var string
@@ -117,7 +117,7 @@ public function addSender($sender, $reason, $description = "")
117
117
throw new \Ovh \Exceptions \InvalidParameterException ("Reason parameter is empty " );
118
118
}
119
119
120
- $ parameters = (object ) array ( "sender " => $ sender , "reason " => $ reason , "description " => $ description) ;
120
+ $ parameters = (object ) [ "sender " => $ sender , "reason " => $ reason , "description " => $ description] ;
121
121
122
122
return $ this ->conn ->post ("/sms/ " .$ this ->account ."/senders " , $ parameters );
123
123
}
@@ -337,7 +337,7 @@ public function getIncomingMessages($startDateTime = null, $endDateTime = null,
337
337
}
338
338
339
339
// Check and prepare parameters
340
- $ parameters = array () ;
340
+ $ parameters = [] ;
341
341
342
342
if (!is_null ($ startDateTime )) {
343
343
if (!is_a ($ startDateTime , "DateTime " )) {
@@ -368,7 +368,7 @@ public function getIncomingMessages($startDateTime = null, $endDateTime = null,
368
368
$ messages = $ this ->conn ->get ($ this ->getUri () . "incoming " , (object ) $ parameters );
369
369
370
370
foreach ($ messages as $ id => $ message ) {
371
- $ messages [$ id ] = new Sms ($ this , "incoming " , $ message );
371
+ $ messages [$ id ] = new Sms ($ this , "incoming " , $ id , $ message );
372
372
}
373
373
374
374
return $ messages ;
@@ -388,7 +388,7 @@ public function getIncomingMessages($startDateTime = null, $endDateTime = null,
388
388
* @throws \GuzzleHttp\Exception\ClientException if http request returns an error
389
389
* @throws \Ovh\Exceptions\InvalidParameterException if account is not set or parameters are invalid
390
390
*/
391
- public function getOutgoingMessages ($ dateStart = null , $ dateEnd = null , $ sender = null , $ receiver = null , $ tag = null )
391
+ public function getOutgoingMessages ($ startDateTime = null , $ endDateTime = null , $ sender = null , $ receiver = null , $ tag = null )
392
392
{
393
393
if (is_null ($ this ->account )) {
394
394
throw new \Ovh \Exceptions \InvalidParameterException ("Please set account before using this function " );
@@ -425,7 +425,7 @@ public function getOutgoingMessages($dateStart = null, $dateEnd = null, $sender
425
425
$ messages = $ this ->conn ->get ($ this ->getUri () . "outgoing " , (object ) $ parameters );
426
426
427
427
foreach ($ messages as $ id => $ message ) {
428
- $ messages [$ id ] = new Sms ($ this , "outgoing " , $ message );
428
+ $ messages [$ id ] = new Sms ($ this , "outgoing " , $ id , $ message );
429
429
}
430
430
431
431
return $ messages ;
@@ -449,7 +449,7 @@ public function getOutgoingMessage($id)
449
449
// Get messages
450
450
$ message = $ this ->conn ->get ($ this ->getUri () . "outgoing/ " . $ id );
451
451
452
- return new Sms ($ this , "outgoing " , $ message );
452
+ return new Sms ($ this , "outgoing " , $ id , $ message );
453
453
}
454
454
455
455
/**
@@ -469,7 +469,7 @@ public function getPlannedMessages()
469
469
$ messages = $ this ->conn ->get ($ this ->getUri () . "jobs " );
470
470
471
471
foreach ($ messages as $ id => $ message ) {
472
- $ messages [$ id ] = new Sms ($ this , "jobs " , $ message );
472
+ $ messages [$ id ] = new Sms ($ this , "jobs " , $ id , $ message );
473
473
}
474
474
475
475
return $ messages ;
@@ -504,7 +504,7 @@ public function getPrice($country, $countryCurrency, $quantity)
504
504
throw new \Ovh \Exceptions \InvalidParameterException ("Quantity parameter is empty " );
505
505
}
506
506
507
- $ parameters = array ( "countryDestination " => $ country , "countryCurrencyPrice " => $ countryCurrency , "quantity " => $ quantity) ;
507
+ $ parameters = [ "countryDestination " => $ country , "countryCurrencyPrice " => $ countryCurrency , "quantity " => $ quantity] ;
508
508
509
509
return $ this ->conn ->get ("/sms/ " .$ this ->account ."/seeOffers " , (object ) $ parameters );
510
510
}
0 commit comments