Skip to content

Commit 13309b4

Browse files
committed
Fixing code style
1 parent cebf5a1 commit 13309b4

File tree

5 files changed

+9
-31
lines changed

5 files changed

+9
-31
lines changed

src/Exceptions/CouldNotSendNotification.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
class CouldNotSendNotification extends \Exception
88
{
9-
/**
10-
* @return static
11-
*/
129
public static function invalidReceiver()
1310
{
1411
return new static(
@@ -17,11 +14,6 @@ public static function invalidReceiver()
1714
);
1815
}
1916

20-
/**
21-
* @param mixed $message
22-
*
23-
* @return static
24-
*/
2517
public static function invalidMessageObject($message)
2618
{
2719
$type = is_object($message) ? get_class($message) : gettype($message);

src/Sns.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ public function __construct(SnsService $snsService)
1818
}
1919

2020
/**
21-
* @param SnsMessage $message
22-
* @param $destination
23-
* @return \Aws\Result
21+
* @param string $destination Phone number as described by the E.164 format.
22+
*
2423
* @throws AwsException
24+
*
25+
* @return \Aws\Result
2526
*/
2627
public function send(SnsMessage $message, $destination)
2728
{
@@ -33,7 +34,7 @@ public function send(SnsMessage $message, $destination)
3334
];
3435

3536
if (! empty($message->getSender())) {
36-
$attributes += [
37+
$attributes += [
3738
'AWS.SNS.SMS.SenderID' => [
3839
'DataType' => 'String',
3940
'StringValue' => $message->getSender(),

src/SnsChannel.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ public function __construct(Sns $sns, Dispatcher $events)
2828
/**
2929
* Send the given notification.
3030
*
31-
* @param mixed $notifiable
32-
* @param \Illuminate\Notifications\Notification $notification
3331
* @return \Aws\Result
3432
*/
3533
public function send($notifiable, Notification $notification)
@@ -53,9 +51,6 @@ public function send($notifiable, Notification $notification)
5351
/**
5452
* Get the phone number to send a notification to.
5553
*
56-
* @param mixed $notifiable
57-
* @param \Illuminate\Notifications\Notification $notification
58-
* @return mixed
5954
* @throws CouldNotSendNotification
6055
*/
6156
protected function getDestination($notifiable, Notification $notification)
@@ -70,16 +65,14 @@ protected function getDestination($notifiable, Notification $notification)
7065
/**
7166
* Try to get the phone number from some commonly used attributes for that.
7267
*
73-
* @param mixed $notifiable
74-
* @return mixed
7568
* @throws CouldNotSendNotification
7669
*/
7770
protected function guessDestination($notifiable)
7871
{
7972
$commonAttributes = ['phone', 'phone_number', 'full_phone'];
8073
foreach ($commonAttributes as $attribute) {
81-
if (isset($notifiable->$attribute)) {
82-
return $notifiable->$attribute;
74+
if (isset($notifiable->{$attribute})) {
75+
return $notifiable->{$attribute};
8376
}
8477
}
8578

@@ -89,9 +82,6 @@ protected function guessDestination($notifiable)
8982
/**
9083
* Get the SNS Message object.
9184
*
92-
* @param $notifiable
93-
* @param Notification $notification
94-
* @return SnsMessage
9585
* @throws CouldNotSendNotification
9686
*/
9787
protected function getMessage($notifiable, Notification $notification): SnsMessage

src/SnsMessage.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public function __construct($content)
4747
/**
4848
* Creates a new instance of the message.
4949
*
50-
* @param array $data
5150
* @return SnsMessage
5251
*/
5352
public static function create(array $data = [])
@@ -58,7 +57,6 @@ public static function create(array $data = [])
5857
/**
5958
* Sets the message body.
6059
*
61-
* @param string $content
6260
* @return $this
6361
*/
6462
public function body(string $content)
@@ -81,7 +79,6 @@ public function getBody()
8179
/**
8280
* Sets the message delivery type as promotional.
8381
*
84-
* @param bool $active
8582
* @return $this
8683
*/
8784
public function promotional(bool $active = true)
@@ -94,7 +91,6 @@ public function promotional(bool $active = true)
9491
/**
9592
* Sets the message delivery type as transactional.
9693
*
97-
* @param bool $active
9894
* @return $this
9995
*/
10096
public function transactional(bool $active = true)
@@ -117,7 +113,6 @@ public function getDeliveryType()
117113
/**
118114
* Sets the message sender identification.
119115
*
120-
* @param string $sender
121116
* @return $this
122117
*/
123118
public function sender(string $sender)

tests/SnsChannelTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class SnsChannelTest extends TestCase
3030
*/
3131
protected $channel;
3232

33-
public function setUp(): void
33+
protected function setUp(): void
3434
{
3535
parent::setUp();
3636

@@ -119,7 +119,7 @@ public function it_will_dispatch_an_event_in_case_of_an_invalid_message()
119119

120120
class Notifiable
121121
{
122-
public $phone_number = null;
122+
public $phone_number;
123123

124124
public function routeNotificationFor()
125125
{

0 commit comments

Comments
 (0)