From d7b4cbd135e522c6fca011e047058167113f41dc Mon Sep 17 00:00:00 2001 From: theimerj Date: Thu, 3 Oct 2024 11:38:50 +0000 Subject: [PATCH] Fix styling --- src/Domain/Newsletter/Events/NewsletterSubscribed.php | 9 ++++----- .../Newsletter/Http/Routing/NewsletterRouteGroup.php | 2 +- src/Drivers/BrevoDriver.php | 8 ++++---- src/LunarApiNewsletterServiceProvider.php | 2 +- tests/Pest.php | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/Domain/Newsletter/Events/NewsletterSubscribed.php b/src/Domain/Newsletter/Events/NewsletterSubscribed.php index 7d702a7..1013250 100644 --- a/src/Domain/Newsletter/Events/NewsletterSubscribed.php +++ b/src/Domain/Newsletter/Events/NewsletterSubscribed.php @@ -6,10 +6,9 @@ class NewsletterSubscribed { - use Dispatchable; + use Dispatchable; - public function __construct( - public string $email, - ) { - } + public function __construct( + public string $email, + ) {} } diff --git a/src/Domain/Newsletter/Http/Routing/NewsletterRouteGroup.php b/src/Domain/Newsletter/Http/Routing/NewsletterRouteGroup.php index b51e189..856abb3 100644 --- a/src/Domain/Newsletter/Http/Routing/NewsletterRouteGroup.php +++ b/src/Domain/Newsletter/Http/Routing/NewsletterRouteGroup.php @@ -16,7 +16,7 @@ class NewsletterRouteGroup extends RouteGroup /** * Register routes. */ - public function routes(string $prefix = null, array|string $middleware = []): void + public function routes(?string $prefix = null, array|string $middleware = []): void { JsonApiRoute::server('v1') ->prefix('v1') diff --git a/src/Drivers/BrevoDriver.php b/src/Drivers/BrevoDriver.php index 898f360..25b6ce6 100644 --- a/src/Drivers/BrevoDriver.php +++ b/src/Drivers/BrevoDriver.php @@ -38,7 +38,7 @@ public function __construct(array $arguments, Lists $lists) ); $this->brevo = new Brevo( - client: new GuzzleClient(), + client: new GuzzleClient, config: $config, ); @@ -81,7 +81,7 @@ protected function createContact( array $listIds = [], array $options = [] ): CreateUpdateContactModel|false { - $createContact = new CreateContact(); + $createContact = new CreateContact; $createContact->setEmail($email); if (! empty($listIds)) { @@ -138,7 +138,7 @@ protected function updateContact( array $listIds = [], array $options = [], ): bool { - $updateContact = new \Brevo\Client\Model\UpdateContact(); + $updateContact = new \Brevo\Client\Model\UpdateContact; if (! empty($listIds)) { $updateContact->setListIds($listIds); @@ -191,7 +191,7 @@ public function unsubscribe(string $email, string $listName = ''): bool|PostCont { $list = $this->lists->findByName($listName); - $contactEmails = new RemoveContactFromList(); + $contactEmails = new RemoveContactFromList; $contactEmails->setEmails([$email]); try { diff --git a/src/LunarApiNewsletterServiceProvider.php b/src/LunarApiNewsletterServiceProvider.php index 1caccc1..c7db2a3 100644 --- a/src/LunarApiNewsletterServiceProvider.php +++ b/src/LunarApiNewsletterServiceProvider.php @@ -26,7 +26,7 @@ public function register(): void // Register the main class to use with the facade $this->app->singleton('lunar-api-newsletter', function () { - return new LunarApiNewsletter(); + return new LunarApiNewsletter; }); } diff --git a/tests/Pest.php b/tests/Pest.php index 9bfbc73..9d4200a 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -1,6 +1,6 @@