Skip to content

Commit

Permalink
Merge branch 'feature/add-cs-validation-messages' of github.com:dystc…
Browse files Browse the repository at this point in the history
…z/lunar-api-newsletter into feature/add-cs-validation-messages
  • Loading branch information
repl6669 committed Oct 3, 2024
2 parents 16f5a6c + d7b4cbd commit 72186ed
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
9 changes: 4 additions & 5 deletions src/Domain/Newsletter/Events/NewsletterSubscribed.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@

class NewsletterSubscribed
{
use Dispatchable;
use Dispatchable;

public function __construct(
public string $email,
) {
}
public function __construct(
public string $email,
) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
8 changes: 4 additions & 4 deletions src/Drivers/BrevoDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(array $arguments, Lists $lists)
);

$this->brevo = new Brevo(
client: new GuzzleClient(),
client: new GuzzleClient,
config: $config,
);

Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/LunarApiNewsletterServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

function serverUrl(string $path = null, bool $full = false): string
function serverUrl(?string $path = null, bool $full = false): string
{
$path = implode('/', [Config::get('lunar-api.general.route_prefix'), 'v1', ltrim($path, '/')]);

Expand Down

0 comments on commit 72186ed

Please sign in to comment.