Skip to content

Commit b035026

Browse files
committed
fix: styling
1 parent 3933146 commit b035026

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/DeclarativeWebPushMessage.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class DeclarativeWebPushMessage implements WebPushMessageInterface
5656
* @var array<string, mixed>
5757
*/
5858
protected array $options = [
59-
'contentType' => 'application/json'
59+
'contentType' => 'application/json',
6060
];
6161

6262
/**
@@ -167,7 +167,7 @@ public function mutable(bool $value = true): static
167167

168168
/**
169169
* Set the navigation target upon activation.
170-
*
170+
*
171171
* @return $this
172172
*/
173173
public function navigate(string $value): static
@@ -221,7 +221,7 @@ public function tag(string $value): static
221221

222222
/**
223223
* Set the timestamp associated with the notification.
224-
*
224+
*
225225
* @return $this
226226
*/
227227
public function timestamp(int $value): static
@@ -288,15 +288,18 @@ public function getOptions(): array
288288
*/
289289
public function toArray(): array
290290
{
291-
if (empty($this->title))
291+
if (empty($this->title)) {
292292
throw MessageValidationFailed::titleRequired();
293-
if (empty($this->navigate))
293+
}
294+
295+
if (empty($this->navigate)) {
294296
throw MessageValidationFailed::navigateRequired();
297+
}
295298

296299
return Arr::whereNotNull([
297300
'web_push' => 8030,
298301
'notification' => Arr::except(array_filter(get_object_vars($this)), ['mutable', 'options']),
299-
'mutable' => $this->mutable ?? null
302+
'mutable' => $this->mutable ?? null,
300303
]);
301304
}
302305
}

src/Exceptions/MessageValidationFailed.php

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

33
namespace NotificationChannels\WebPush\Exceptions;
44

5-
use Exception;
6-
75
class MessageValidationFailed extends \Exception
86
{
97
public static function titleRequired(): static

src/WebPushMessageInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Illuminate\Contracts\Support\Arrayable;
66

7-
87
interface WebPushMessageInterface extends Arrayable
98
{
109
//

tests/DeclarativeMessageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
namespace NotificationChannels\WebPush\Test;
44

55
use NotificationChannels\WebPush\DeclarativeWebPushMessage;
6+
use NotificationChannels\WebPush\Exceptions\MessageValidationFailed;
67
use PHPUnit\Framework\Attributes\Test;
78
use PHPUnit\Framework\TestCase;
8-
use NotificationChannels\WebPush\Exceptions\MessageValidationFailed;
99

1010
class DeclarativeMessageTest extends TestCase
1111
{

0 commit comments

Comments
 (0)