File tree Expand file tree Collapse file tree 9 files changed +41
-41
lines changed Expand file tree Collapse file tree 9 files changed +41
-41
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace NotificationChannels \Twilio \Exceptions ;
4
4
5
- use NotificationChannels \Twilio \CallMessage ;
6
5
use NotificationChannels \Twilio \SmsMessage ;
6
+ use NotificationChannels \Twilio \CallMessage ;
7
7
8
8
class CouldNotSendNotification extends \Exception
9
9
{
Original file line number Diff line number Diff line change 2
2
3
3
namespace NotificationChannels \Twilio ;
4
4
5
- use NotificationChannels \Twilio \Exceptions \CouldNotSendNotification ;
6
5
use Twilio \Rest \Client as TwilioService ;
6
+ use NotificationChannels \Twilio \Exceptions \CouldNotSendNotification ;
7
7
8
8
class Twilio
9
9
{
@@ -124,7 +124,5 @@ protected function getAlphanumericSender()
124
124
if ($ sender = $ this ->config ->getAlphanumericSender ()) {
125
125
return $ sender ;
126
126
}
127
-
128
- return null ;
129
127
}
130
128
}
Original file line number Diff line number Diff line change 5
5
use Exception ;
6
6
use Illuminate \Notifications \Notification ;
7
7
use Illuminate \Contracts \Events \Dispatcher ;
8
- use NotificationChannels \Twilio \Exceptions \CouldNotSendNotification ;
9
8
use Illuminate \Notifications \Events \NotificationFailed ;
9
+ use NotificationChannels \Twilio \Exceptions \CouldNotSendNotification ;
10
10
11
11
class TwilioChannel
12
12
{
Original file line number Diff line number Diff line change @@ -29,24 +29,24 @@ public function getAuthToken()
29
29
return $ this ->config ['auth_token ' ];
30
30
}
31
31
32
- /**
33
- * Get the username.
34
- *
35
- * @return string
36
- */
37
- public function getUsername ()
32
+ /**
33
+ * Get the username.
34
+ *
35
+ * @return string
36
+ */
37
+ public function getUsername ()
38
38
{
39
- return $ this ->config ['username ' ];
39
+ return $ this ->config ['username ' ];
40
40
}
41
41
42
- /**
43
- * Get the password.
44
- *
45
- * @return string
46
- */
47
- public function getPassword ()
42
+ /**
43
+ * Get the password.
44
+ *
45
+ * @return string
46
+ */
47
+ public function getPassword ()
48
48
{
49
- return $ this ->config ['password ' ];
49
+ return $ this ->config ['password ' ];
50
50
}
51
51
52
52
/**
Original file line number Diff line number Diff line change @@ -25,11 +25,13 @@ public function boot()
25
25
$ config = $ this ->app ['config ' ]['services.twilio ' ];
26
26
$ account_sid = array_get ($ config , 'account_sid ' );
27
27
$ username = array_get ($ config , 'username ' );
28
- if (!empty ($ username )) {
28
+ if (! empty ($ username )) {
29
29
$ password = array_get ($ config , 'password ' );
30
+
30
31
return new TwilioService ($ username , $ password , $ account_sid );
31
32
} else {
32
33
$ auth_token = array_get ($ config , 'auth_token ' );
34
+
33
35
return new TwilioService ($ account_sid , $ auth_token );
34
36
}
35
37
});
Original file line number Diff line number Diff line change 2
2
3
3
namespace NotificationChannels \Twilio \Test ;
4
4
5
- use Illuminate \Contracts \Events \Dispatcher ;
6
- use Illuminate \Notifications \Notification ;
7
5
use Mockery ;
8
- use Mockery \Adapter \Phpunit \MockeryTestCase ;
9
- use NotificationChannels \Twilio \TwilioCallMessage ;
10
- use NotificationChannels \Twilio \TwilioChannel ;
11
- use NotificationChannels \Twilio \TwilioConfig ;
12
- use NotificationChannels \Twilio \TwilioSmsMessage ;
13
6
use NotificationChannels \Twilio \Twilio ;
14
7
use Twilio \Rest \Client as TwilioService ;
15
- use Twilio \Rest \Api \V2010 \Account \MessageList ;
8
+ use Illuminate \Notifications \Notification ;
9
+ use Illuminate \Contracts \Events \Dispatcher ;
16
10
use Twilio \Rest \Api \V2010 \Account \CallList ;
11
+ use Mockery \Adapter \Phpunit \MockeryTestCase ;
12
+ use NotificationChannels \Twilio \TwilioConfig ;
13
+ use NotificationChannels \Twilio \TwilioChannel ;
14
+ use Twilio \Rest \Api \V2010 \Account \MessageList ;
15
+ use NotificationChannels \Twilio \TwilioSmsMessage ;
16
+ use NotificationChannels \Twilio \TwilioCallMessage ;
17
17
18
18
class IntegrationTest extends MockeryTestCase
19
19
{
Original file line number Diff line number Diff line change 2
2
3
3
namespace NotificationChannels \Twilio \Test ;
4
4
5
- use Illuminate \Contracts \Events \Dispatcher ;
6
- use Illuminate \Notifications \Events \NotificationFailed ;
7
5
use Mockery ;
6
+ use NotificationChannels \Twilio \Twilio ;
8
7
use Illuminate \Notifications \Notification ;
8
+ use Illuminate \Contracts \Events \Dispatcher ;
9
9
use Mockery \Adapter \Phpunit \MockeryTestCase ;
10
- use NotificationChannels \Twilio \TwilioCallMessage ;
11
10
use NotificationChannels \Twilio \TwilioChannel ;
12
11
use NotificationChannels \Twilio \TwilioSmsMessage ;
13
- use NotificationChannels \Twilio \Twilio ;
12
+ use NotificationChannels \Twilio \TwilioCallMessage ;
13
+ use Illuminate \Notifications \Events \NotificationFailed ;
14
14
15
15
class TwilioChannelTest extends MockeryTestCase
16
16
{
Original file line number Diff line number Diff line change 4
4
5
5
use Mockery ;
6
6
use ArrayAccess ;
7
+ use NotificationChannels \Twilio \Twilio ;
7
8
use Twilio \Rest \Client as TwilioService ;
8
9
use Mockery \Adapter \Phpunit \MockeryTestCase ;
9
- use NotificationChannels \Twilio \Twilio ;
10
- use NotificationChannels \Twilio \TwilioChannel ;
11
10
use NotificationChannels \Twilio \TwilioConfig ;
11
+ use NotificationChannels \Twilio \TwilioChannel ;
12
12
use NotificationChannels \Twilio \TwilioProvider ;
13
13
use Illuminate \Contracts \Foundation \Application ;
14
14
Original file line number Diff line number Diff line change 2
2
3
3
namespace NotificationChannels \Twilio \Test ;
4
4
5
- use Illuminate \Contracts \Events \Dispatcher ;
6
5
use Mockery ;
6
+ use Services_Twilio_Rest_Calls ;
7
+ use Services_Twilio_Rest_Messages ;
8
+ use NotificationChannels \Twilio \Twilio ;
9
+ use Twilio \Rest \Client as TwilioService ;
10
+ use Illuminate \Contracts \Events \Dispatcher ;
7
11
use Mockery \Adapter \Phpunit \MockeryTestCase ;
8
- use NotificationChannels \Twilio \Exceptions \CouldNotSendNotification ;
9
12
use NotificationChannels \Twilio \TwilioConfig ;
10
13
use NotificationChannels \Twilio \TwilioMessage ;
11
- use NotificationChannels \Twilio \TwilioCallMessage ;
12
14
use NotificationChannels \Twilio \TwilioSmsMessage ;
13
- use NotificationChannels \Twilio \Twilio ;
14
- use Services_Twilio_Rest_Calls ;
15
- use Services_Twilio_Rest_Messages ;
16
- use Twilio \Rest \Client as TwilioService ;
15
+ use NotificationChannels \Twilio \TwilioCallMessage ;
16
+ use NotificationChannels \Twilio \Exceptions \CouldNotSendNotification ;
17
17
18
18
class TwilioTest extends MockeryTestCase
19
19
{
You can’t perform that action at this time.
0 commit comments