Skip to content

Commit 76a6ba8

Browse files
committed
style: pint
1 parent 2ee051a commit 76a6ba8

11 files changed

+16
-22
lines changed

database/migrations/2022_12_21_091846_add_unique_to_expo_tokens.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Illuminate\Database\Schema\Blueprint;
77
use Illuminate\Support\Facades\Schema;
88

9-
return new class() extends Migration
9+
return new class extends Migration
1010
{
1111
public function up(): void
1212
{

src/Dto/ExpoMessage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ final class ExpoMessage implements Arrayable, Jsonable
4747

4848
public static function create(): ExpoMessage
4949
{
50-
return new ExpoMessage();
50+
return new ExpoMessage;
5151
}
5252

5353
public function to(?array $value): self
@@ -183,7 +183,7 @@ public static function fromJson($jsonData): ExpoMessage
183183
{
184184
$data = json_decode($jsonData, true);
185185

186-
$expoMessage = new self();
186+
$expoMessage = new self;
187187
foreach ($data as $key => $value) {
188188
if ($key === 'data') {
189189
$expoMessage->jsonData($value);

src/Dto/ExpoNotification.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class ExpoNotification implements Arrayable
1414

1515
public static function make(int|string $id, ExpoMessage $message): ExpoNotification
1616
{
17-
return (new ExpoNotification())
17+
return (new ExpoNotification)
1818
->id($id)
1919
->message($message);
2020
}

src/Dto/ExpoTicket.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class ExpoTicket implements Arrayable
1414

1515
public static function make(int|string $id, string $token): ExpoTicket
1616
{
17-
return (new ExpoTicket())
17+
return (new ExpoTicket)
1818
->id($id)
1919
->token($token);
2020
}

src/Dto/ExpoToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class ExpoToken implements Arrayable
1717

1818
public static function make(int|string $id, string $value, Model $owner): ExpoToken
1919
{
20-
return (new ExpoToken())
20+
return (new ExpoToken)
2121
->id($id)
2222
->value($value)
2323
->owner($owner);

src/Events/InvalidExpoToken.php

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

77
final class InvalidExpoToken
88
{
9-
public function __construct(public readonly string $token)
10-
{
11-
}
9+
public function __construct(public readonly string $token) {}
1210
}

src/ExpoNotificationsChannel.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ final class ExpoNotificationsChannel
1313
{
1414
public function __construct(
1515
protected readonly ExpoNotificationsServiceInterface $expoNotificationsService,
16-
) {
17-
}
16+
) {}
1817

1918
/**
2019
* @throws ExpoNotificationsException

src/ExpoNotificationsService.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,11 @@ public function __construct(
5454
];
5555

5656
if ($accessToken) {
57-
$headers['Authorization'] = 'Bearer ' . $accessToken;
57+
$headers['Authorization'] = 'Bearer '.$accessToken;
5858
}
5959

6060
$this->http = Http::withHeaders($headers)->baseUrl($apiUrl);
6161

62-
6362
// https://expo.dev/blog/expo-adds-support-for-fcm-http-v1-api
6463
if (config('expo-notifications.service.use_fcm_legacy_api')) {
6564
$this->http->withQueryParameters([
@@ -107,7 +106,7 @@ public function receipts(Collection|array $tokenIds): Collection
107106
}
108107

109108
return collect($data['data'])->map(function ($responseItem, $id) {
110-
$data = (new PushReceiptResponse())
109+
$data = (new PushReceiptResponse)
111110
->id($id)
112111
->status($responseItem['status']);
113112

@@ -204,14 +203,14 @@ private function setTicketsFromData(array $data): ExpoNotificationsService
204203
->each(function ($responseItem) {
205204
if ($responseItem['status'] === ExpoResponseStatus::ERROR->value) {
206205
$this->tickets->push(
207-
(new PushTicketResponse())
206+
(new PushTicketResponse)
208207
->status($responseItem['status'])
209208
->message($responseItem['message'])
210209
->details($responseItem['details'])
211210
);
212211
} else {
213212
$this->tickets->push(
214-
(new PushTicketResponse())
213+
(new PushTicketResponse)
215214
->status($responseItem['status'])
216215
->ticketId($responseItem['id'])
217216
);

src/FakeExpoNotificationsService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ private function setTicketsFromData(array $data): FakeExpoNotificationsService
144144
->each(function ($responseItem) {
145145
if ($responseItem['status'] === ExpoResponseStatus::ERROR->value) {
146146
$this->tickets->push(
147-
(new PushTicketResponse())
147+
(new PushTicketResponse)
148148
->status($responseItem['status'])
149149
->message($responseItem['message'])
150150
->details($responseItem['details'])
151151
);
152152
} else {
153153
$this->tickets->push(
154-
(new PushTicketResponse())
154+
(new PushTicketResponse)
155155
->status($responseItem['status'])
156156
->ticketId($responseItem['id'])
157157
);

src/Listeners/DeleteInvalidExpoToken.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010
class DeleteInvalidExpoToken
1111
{
12-
public function __construct(protected readonly ExpoTokenStorageInterface $tokenStorage)
13-
{
14-
}
12+
public function __construct(protected readonly ExpoTokenStorageInterface $tokenStorage) {}
1513

1614
public function handle(InvalidExpoToken $event): void
1715
{

tests/Feature/ExpoNotificationServiceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
for ($i = 0; $i < 120; $i++) {
1717
$this->messages->push(
18-
(new ExpoMessage())
18+
(new ExpoMessage)
1919
->to([Str::orderedUuid()->toString()])
2020
->title("A beautiful title #$i")
2121
->body('This is a content')

0 commit comments

Comments
 (0)