From 536bd889a8c68d8fd60c53da5fee464d30526333 Mon Sep 17 00:00:00 2001 From: emchooo Date: Fri, 7 Aug 2020 13:07:33 +0000 Subject: [PATCH] Apply fixes from StyleCI --- app/Console/Commands/MailnessInstallCommand.php | 6 +++--- app/Jobs/SendCampaign.php | 3 --- app/Jobs/SendEmail.php | 1 - app/Mail/CampaignMail.php | 7 +++---- app/Rules/EmailUniqueForEachListRule.php | 2 +- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/app/Console/Commands/MailnessInstallCommand.php b/app/Console/Commands/MailnessInstallCommand.php index eb01430..f8831a9 100644 --- a/app/Console/Commands/MailnessInstallCommand.php +++ b/app/Console/Commands/MailnessInstallCommand.php @@ -31,10 +31,10 @@ public function handle() $this->createEnvFile(); - if (strlen(config('app.key')) === 0) : + if (strlen(config('app.key')) === 0) { $this->call('key:generate'); - $this->line('Secret key properly generated'); - endif; + $this->line('Secret key properly generated'); + } $credentials = $this->requestDatabaseCredentials(); diff --git a/app/Jobs/SendCampaign.php b/app/Jobs/SendCampaign.php index 71b4abc..8bd1afc 100644 --- a/app/Jobs/SendCampaign.php +++ b/app/Jobs/SendCampaign.php @@ -6,13 +6,11 @@ use App\Models\Lists; use App\Models\SendingLog; use App\Models\Service; -use DOMDocument; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; -use Illuminate\Support\Str; class SendCampaign implements ShouldQueue { @@ -52,5 +50,4 @@ public function handle() SetCampaignAsSent::dispatch($this->campaign); } - } diff --git a/app/Jobs/SendEmail.php b/app/Jobs/SendEmail.php index 9dd9159..7359c99 100644 --- a/app/Jobs/SendEmail.php +++ b/app/Jobs/SendEmail.php @@ -5,7 +5,6 @@ use App\Jobs\Middleware\RateLimited; use App\Mail\CampaignMail; use App\Models\SendingLog; -use DOMDocument; use Exception; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; diff --git a/app/Mail/CampaignMail.php b/app/Mail/CampaignMail.php index 2561d85..e270815 100644 --- a/app/Mail/CampaignMail.php +++ b/app/Mail/CampaignMail.php @@ -2,10 +2,10 @@ namespace App\Mail; +use App\Models\SendingLog; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -use App\Models\SendingLog; class CampaignMail extends Mailable { @@ -36,12 +36,11 @@ public function __construct(SendingLog $send, $config) */ public function build() { - return $this->html($this->getMailContent()); } - protected function getMailContent() { + protected function getMailContent() + { return $this->send->campaign->html_formated; } - } diff --git a/app/Rules/EmailUniqueForEachListRule.php b/app/Rules/EmailUniqueForEachListRule.php index 7809a1b..e01ba42 100644 --- a/app/Rules/EmailUniqueForEachListRule.php +++ b/app/Rules/EmailUniqueForEachListRule.php @@ -40,7 +40,7 @@ public function passes($attribute, $value) return null === Contact::query() ->where('email', $value) - ->when($this->list, function (Builder $query) use ($contact) { + ->when($this->list, function (Builder $query) { return $query->where('list_id', '=', $this->list->id); }) ->when($contact, function (Builder $query) use ($contact) {