Skip to content

Commit 2b5a35d

Browse files
authored
fix styleCI (#23)
* wip * wip * wip * wip
1 parent 20af583 commit 2b5a35d

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

src/AfricasTalkingChannel.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace NotificationChannels\AfricasTalking;
44

5+
use AfricasTalking\SDK\AfricasTalking as AfricasTalkingSDK;
56
use Exception;
67
use Illuminate\Notifications\Notification;
7-
use AfricasTalking\SDK\AfricasTalking as AfricasTalkingSDK;
8-
use NotificationChannels\AfricasTalking\Exceptions\InvalidPhonenumber;
98
use NotificationChannels\AfricasTalking\Exceptions\CouldNotSendNotification;
9+
use NotificationChannels\AfricasTalking\Exceptions\InvalidPhonenumber;
1010

1111
class AfricasTalkingChannel
1212
{
@@ -22,8 +22,9 @@ public function __construct(AfricasTalkingSDK $africasTalking)
2222
/**
2323
* Send the given notification.
2424
*
25-
* @param mixed $notifiable
26-
* @param \Illuminate\Notifications\Notification $notification
25+
* @param mixed $notifiable
26+
* @param \Illuminate\Notifications\Notification $notification
27+
*
2728
* @throws CouldNotSendNotification
2829
*/
2930
public function send($notifiable, Notification $notification)
@@ -32,7 +33,7 @@ public function send($notifiable, Notification $notification)
3233

3334
$phoneNumber = $this->getTo($notifiable, $notification, $message);
3435

35-
if(empty($phoneNumber)) {
36+
if (empty($phoneNumber)) {
3637
throw InvalidPhonenumber::configurationNotSet();
3738
}
3839

@@ -43,10 +44,10 @@ public function send($notifiable, Notification $notification)
4344
];
4445
} else {
4546
$params = [
46-
'to' => $phoneNumber,
47-
'message' => $message->getContent(),
48-
'from' => $message->getSender(),
49-
];
47+
'to' => $phoneNumber,
48+
'message' => $message->getContent(),
49+
'from' => $message->getSender(),
50+
];
5051
}
5152

5253
try {
@@ -56,10 +57,9 @@ public function send($notifiable, Notification $notification)
5657
}
5758
}
5859

59-
6060
private function getTo($notifiable, Notification $notification, AfricasTalkingMessage $message)
6161
{
62-
if(!empty($message->getTo())) {
62+
if (! empty($message->getTo())) {
6363
return $message->getTo();
6464
}
6565

src/AfricasTalkingMessage.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class AfricasTalkingMessage
1616
/**
1717
* Set content for this message.
1818
*
19-
* @param string $content
20-
* @return this
19+
* @param string $content
20+
* @return $this
2121
*/
2222
public function content(string $content): self
2323
{
@@ -29,7 +29,7 @@ public function content(string $content): self
2929
/**
3030
* Set sender for this message.
3131
*
32-
* @param string $from
32+
* @param string $from
3333
* @return self
3434
*/
3535
public function from(string $from): self
@@ -39,10 +39,10 @@ public function from(string $from): self
3939
return $this;
4040
}
4141

42-
/**
42+
/**
4343
* Set recipient for this message.
4444
*
45-
* @param string $from
45+
* @param string $from
4646
* @return self
4747
*/
4848
public function to(string $to): self

src/Exceptions/CouldNotSendNotification.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,17 @@
77
class CouldNotSendNotification extends Exception
88
{
99
/**
10-
* @param string $error
10+
* @param string $error
1111
* @return CouldNotSendNotification
1212
*/
1313
public static function serviceRespondedWithAnError(string $error): self
1414
{
1515
return new static("AfricasTalking service responded with an error: {$error}");
1616
}
1717

18-
1918
public static function invalidReceiver(): self
2019
{
21-
return new static("The notifiable did not have a receiving phone number. Add a routeNotificationForAfricasTalking
22-
method or a phone_number attribute to your notifiable.");
20+
return new static('The notifiable did not have a receiving phone number. Add a routeNotificationForAfricasTalking
21+
method or a phone_number attribute to your notifiable.');
2322
}
2423
}

tests/AfricasTalkingChannelTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function it_can_send_sms_notification_to_anonymous_notifiable_using_class
5959
->once()
6060
->andReturn(200);
6161

62-
$this->channel->send((new AnonymousNotifiable())->route(AfricasTalkingChannel::class, "+1111111111"), new TestNotification);
62+
$this->channel->send((new AnonymousNotifiable())->route(AfricasTalkingChannel::class, '+1111111111'), new TestNotification);
6363
}
6464

6565
/** @test */
@@ -73,7 +73,7 @@ public function it_can_send_sms_notification_to_anonymous_notifiable_using_strin
7373
->once()
7474
->andReturn(200);
7575

76-
$this->channel->send((new AnonymousNotifiable())->route('africasTalking', "+1111111111"), new TestNotification);
76+
$this->channel->send((new AnonymousNotifiable())->route('africasTalking', '+1111111111'), new TestNotification);
7777
}
7878

7979
/** @test */
@@ -123,6 +123,7 @@ class TestNotification extends Notification
123123
/**
124124
* @param $notifiable
125125
* @return AfricasTalkingMessage
126+
*
126127
* @throws CouldNotSendNotification
127128
*/
128129
public function toAfricasTalking($notifiable)
@@ -136,6 +137,7 @@ class TestNotificationWithGetTo extends Notification
136137
/**
137138
* @param $notifiable
138139
* @return AfricasTalkingMessage
140+
*
139141
* @throws CouldNotSendNotification
140142
*/
141143
public function toAfricasTalking($notifiable)
@@ -145,7 +147,6 @@ public function toAfricasTalking($notifiable)
145147
}
146148
}
147149

148-
149150
class Notifiable
150151
{
151152
public $phone_number = null;

0 commit comments

Comments
 (0)