Skip to content

Commit f6b67f2

Browse files
committed
Code style fixes.
1 parent 3df8216 commit f6b67f2

File tree

9 files changed

+9
-29
lines changed

9 files changed

+9
-29
lines changed

src/Events/SnsConfirmationRequestReceived.php

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

33

44
namespace Nipwaayoni\SnsHandler\Events;
5+
56
use Illuminate\Broadcasting\InteractsWithSockets;
67
use Illuminate\Foundation\Events\Dispatchable;
78
use Nipwaayoni\SnsHandler\SnsMessage;
89

9-
1010
class SnsConfirmationRequestReceived
1111
{
1212
use Dispatchable, InteractsWithSockets;
@@ -22,6 +22,4 @@ public function message(): SnsMessage
2222
{
2323
return $this->message;
2424
}
25-
26-
27-
}
25+
}

src/Events/SnsMessageReceived.php

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

33

44
namespace Nipwaayoni\SnsHandler\Events;
5+
56
use Illuminate\Broadcasting\InteractsWithSockets;
67
use Illuminate\Foundation\Events\Dispatchable;
78
use Nipwaayoni\SnsHandler\SnsMessage;
89

9-
1010
class SnsMessageReceived
1111
{
1212
use Dispatchable, InteractsWithSockets;
@@ -22,6 +22,4 @@ public function message(): SnsMessage
2222
{
2323
return $this->message;
2424
}
25-
26-
27-
}
25+
}

src/Listeners/SnsConfirmationRequestListener.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33

44
namespace Nipwaayoni\SnsHandler\Listeners;
55

6-
76
use Illuminate\Support\Facades\Http;
87
use Illuminate\Support\Facades\Log;
98
use Nipwaayoni\SnsHandler\Events\SnsConfirmationRequestReceived;
109
use Nipwaayoni\SnsHandler\SnsConfirmSubscriptionException;
1110

1211
class SnsConfirmationRequestListener
1312
{
14-
1513
public function handle(SnsConfirmationRequestReceived $event)
1614
{
1715
$message = $event->message();
@@ -20,11 +18,10 @@ public function handle(SnsConfirmationRequestReceived $event)
2018
if ($response->successful()) {
2119
$info = sprintf('Subscription confirmation for %s succeeded with status %s', $message->topicArn(), $response->status());
2220
Log::info($info);
23-
return;
21+
return;
2422
}
2523
$error = sprintf('Subscription confirmation for %s failed with status %s', $message->topicArn(), $response->status());
2624
Log::error($error);
2725
throw new SnsConfirmSubscriptionException($error);
2826
}
29-
30-
}
27+
}

src/Providers/EventServiceProvider.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,15 @@
33

44
namespace Nipwaayoni\SnsHandler\Providers;
55

6-
76
use Illuminate\Support\ServiceProvider;
87
use Nipwaayoni\SnsHandler\Events\SnsConfirmationRequestReceived;
98
use Nipwaayoni\SnsHandler\Listeners\SnsConfirmationRequestListener;
109

11-
1210
class EventServiceProvider extends ServiceProvider
1311
{
1412
protected $listen = [
1513
SnsConfirmationRequestReceived::class => [
1614
SnsConfirmationRequestListener::class,
1715
]
1816
];
19-
20-
}
17+
}

src/SnsBroker.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private function getNotificationEvent(string $arn)
8181
private function arnMap(string $arn, array $map)
8282
{
8383
$default = null;
84-
foreach($map as $className => $arnList) {
84+
foreach ($map as $className => $arnList) {
8585
if ($arnList[0] === '*') {
8686
$default = $className;
8787
}
@@ -91,8 +91,5 @@ private function arnMap(string $arn, array $map)
9191
}
9292

9393
return $default;
94-
9594
}
96-
97-
9895
}

src/Testing/ReceivesSnsMessages.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
*/
1515
trait ReceivesSnsMessages
1616
{
17-
1817
public function sendSnsMessage(string $data, string $arn = "default"): TestResponse
1918
{
2019
$headers = [

tests/Feature/SnsHandlerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Nipwaayoni\SnsHandler\SnsMessage;
1616
use Nipwaayoni\Tests\SnsHandler\MakesSnsTests;
1717

18-
1918
class SnsHandlerTest extends \Nipwaayoni\Tests\SnsHandler\TestCase
2019
{
2120
use MakesSnsTests;

tests/Unit/SnsBrokerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Nipwaayoni\Tests\SnsHandler\MakesSnsTests;
1616
use Nipwaayoni\Tests\SnsHandler\TestCase;
1717

18-
1918
class SnsBrokerTest extends TestCase
2019
{
2120
use MakesSnsTests;
@@ -91,7 +90,6 @@ public function testDispatchesSnsConfirmationRequestEvent(): void
9190

9291
public function testDispatchesDefaultNotificationMessage(): void
9392
{
94-
9593
$request = $this->createMock(SnsHttpRequest::class);
9694
$request->expects($this->once())->method('jsonContent')
9795
->willReturn($this->makeSnsMessageJson([

tests/Unit/SnsConfirmationRequestListenerTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
namespace Nipwaayoni\Tests\SnsHandler\Unit;
55

6-
76
use Aws\Sns\Message;
87
use Illuminate\Http\Client\Request;
98
use Illuminate\Support\Facades\Event;
@@ -54,7 +53,6 @@ public function testThrowsExceptionIfConfirmSubscriptionFails(): void
5453

5554
public function testConfirmsSubscriptionUsingSubscribeUrl(): void
5655
{
57-
5856
Http::fake(['https://aws.amazon.com/subscribe/123' => Http::response([], 200, [])]);
5957

6058
$message = Message::fromJsonString($this->makeSnsMessageJson([
@@ -72,5 +70,4 @@ public function testConfirmsSubscriptionUsingSubscribeUrl(): void
7270
return $request->url() === 'https://aws.amazon.com/subscribe/123';
7371
});
7472
}
75-
76-
}
73+
}

0 commit comments

Comments
 (0)