Skip to content
This repository was archived by the owner on Dec 18, 2023. It is now read-only.

Commit d4554fc

Browse files
committed
Some fixes
1 parent a95b930 commit d4554fc

4 files changed

Lines changed: 17 additions & 7 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
build
33
composer.phar
44
composer.lock
5-
.DS_Store
5+
.DS_Store
6+
example.php

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ $client = new Mobtexting\Client($token);
3333
$message = $client->messages->send(
3434
'1234567890', // Text this number
3535
array(
36-
'from' => '9991231234', // From a valid Twilio number
37-
'text' => 'Hello from Twilio!'
36+
'from' => 'MOBtxt',
37+
'text' => 'Hello from MOBTEXTING!'
3838
)
3939
);
4040

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"require": {
1313
"php": ">=5.6",
14-
"mobtexting/message-sdk": "dev-master"
14+
"mobtexting/message-sdk": "1.0"
1515
},
1616
"require-dev": {
1717
"mockery/mockery": "^0.9.5",

src/Client.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Client
88
{
99
protected $username;
1010
protected $password;
11-
protected $messages;
11+
protected $messages = null;
1212

1313
/**
1414
* Mobtexting constructor.
@@ -20,8 +20,6 @@ public function __construct($username = null, $password = null)
2020
{
2121
$this->username = $username;
2222
$this->password = $password;
23-
24-
$this->setMessages();
2523
}
2624

2725
/**
@@ -65,9 +63,20 @@ public function setPassword($password)
6563
*/
6664
public function getMessages()
6765
{
66+
if (is_null($this->messages)) {
67+
$this->setMessages();
68+
}
69+
6870
return $this->messages;
6971
}
7072

73+
public function __get($name)
74+
{
75+
$name = 'get' . ucfirst($name);
76+
77+
return $this->{$name}();
78+
}
79+
7180
/**
7281
* Set the value of messages
7382
*

0 commit comments

Comments
 (0)