Skip to content

Commit

Permalink
Merge pull request #3 from goldspecdigital/develop
Browse files Browse the repository at this point in the history
Removed Nullable Type Hints
  • Loading branch information
matthew-inamdar authored Dec 28, 2017
2 parents af78eec + 4e92738 commit 63f55a3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Simply pull in the package in with composer:
$ composer require goldspecdigital/voodoo-sms-sdk
```

### Example
### Examples

#### Send an SMS

```php
<?php
Expand All @@ -40,6 +42,30 @@ var_dump($response);
*/
```

#### Get the Delivery Status for an SMS

```php
<?php

use GoldSpecDigital\VoodooSmsSdk\Client;

$client = new Client('username', 'password', 'CompanyName');

$response = $client->getDeliveryStatus('A3dads...');

var_dump($response);

/*
{
"result": "200 OK",
"reference_id": "A3dads...",
"message": "This is a test message",
"delivery_status": "Delivered",
"delivery_datetime": "2017-12-28 00:06:09"
}
*/
```

## Running the tests

To run the test you will need to have Voodoo SMS credentials stored in a `.env` file placed in the project root. An example file is provided for you with the keys required: `.env.example`.
Expand Down
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Client
* @param string $password
* @param null|string $from
*/
public function __construct(string $username, string $password, ?string $from = null)
public function __construct(string $username, string $password, string $from = null)
{
$this->httpClient = new HttpClient(static::URI);
$this->username = $username;
Expand All @@ -70,7 +70,7 @@ public function __construct(string $username, string $password, ?string $from =
* @throws \GoldSpecDigital\VoodooSmsSdk\Exceptions\MessageTooLongException
* @throws \GoldSpecDigital\VoodooSmsSdk\Exceptions\ExternalReferenceTooLongException
*/
public function send(string $message, string $to, ?string $from = null, ?string $externalReference = null): object
public function send(string $message, string $to, string $from = null, string $externalReference = null): object
{
if (strlen($message) > static::MESSAGE_LIMIT) {
throw new MessageTooLongException();
Expand Down

0 comments on commit 63f55a3

Please sign in to comment.