diff --git a/database/migrations/6_transform_logs_cc_bcc_array.php b/database/migrations/6_transform_logs_cc_bcc_array.php index 644cd93..4c69284 100644 --- a/database/migrations/6_transform_logs_cc_bcc_array.php +++ b/database/migrations/6_transform_logs_cc_bcc_array.php @@ -10,7 +10,7 @@ */ public function up(): void { - $tableName = (new Log())->getTable(); + $tableName = (new Log)->getTable(); DB::table($tableName) ->whereNotNull('cc') diff --git a/src/Actions/Templates/Preview.php b/src/Actions/Templates/Preview.php index 775e9f0..9374617 100644 --- a/src/Actions/Templates/Preview.php +++ b/src/Actions/Templates/Preview.php @@ -18,7 +18,7 @@ public function __construct(private readonly Render $render) */ public function run(array $data): string { - $template = Template::find($data['templateId']) ?: new Template(); + $template = Template::find($data['templateId']) ?: new Template; $template->content = $data['content']; return rescue( diff --git a/src/Commands/TokenCommand.php b/src/Commands/TokenCommand.php index 01a1691..23083ca 100644 --- a/src/Commands/TokenCommand.php +++ b/src/Commands/TokenCommand.php @@ -22,7 +22,7 @@ public function handle(): int ); info('Generated token:'); - note((new GenerateToken())->run($name)); + note((new GenerateToken)->run($name)); return self::SUCCESS; } diff --git a/src/Exceptions/SendingFailedException.php b/src/Exceptions/SendingFailedException.php index db0fbec..da2687b 100644 --- a/src/Exceptions/SendingFailedException.php +++ b/src/Exceptions/SendingFailedException.php @@ -35,7 +35,7 @@ public function context(): array return [ 'logId' => $this->log?->id, 'trigger' => $this->log?->trigger, - 'variables' => $this->log?->variables ?: new ArrayObject(), + 'variables' => $this->log?->variables ?: new ArrayObject, ]; } } diff --git a/src/Helpers/TemplateManager.php b/src/Helpers/TemplateManager.php index 844c979..303f41b 100644 --- a/src/Helpers/TemplateManager.php +++ b/src/Helpers/TemplateManager.php @@ -33,7 +33,7 @@ public function extractVariableNames(): array { $source = $this->template->layout?->content . $this->template->content; - $twig = new Environment(new ArrayLoader()); + $twig = new Environment(new ArrayLoader); try { $nodes = $twig->parse( diff --git a/src/Http/Controllers/SocialAuthController.php b/src/Http/Controllers/SocialAuthController.php index f908051..cf3c1fe 100644 --- a/src/Http/Controllers/SocialAuthController.php +++ b/src/Http/Controllers/SocialAuthController.php @@ -17,7 +17,7 @@ class SocialAuthController extends Controller public function redirect(): RedirectResponse { if (!MailCarrier::getSocialAuthDriver()) { - throw new SocialAuthNotEnabledException(); + throw new SocialAuthNotEnabledException; } return Socialite::driver(MailCarrier::getSocialAuthDriver())->redirect(); @@ -29,7 +29,7 @@ public function redirect(): RedirectResponse public function callback(SocialLogin $login): RedirectResponse { if (!MailCarrier::getSocialAuthDriver()) { - throw new SocialAuthNotEnabledException(); + throw new SocialAuthNotEnabledException; } /** @var \Laravel\Socialite\AbstractUser $user */ diff --git a/src/Http/Requests/SendMailRequest.php b/src/Http/Requests/SendMailRequest.php index caad5ae..1ba75b0 100644 --- a/src/Http/Requests/SendMailRequest.php +++ b/src/Http/Requests/SendMailRequest.php @@ -25,11 +25,11 @@ public function rules(): array 'template' => 'required|exists:\MailCarrier\Models\Template,slug', 'trigger' => 'sometimes|string|max:255', 'subject' => 'required|string|max:255', - 'sender' => ['sometimes', new ContactRule()], + 'sender' => ['sometimes', new ContactRule], 'cc' => 'sometimes|array', 'bcc' => 'sometimes|array', - 'cc.*' => [new ContactRule()], - 'bcc.*' => [new ContactRule()], + 'cc.*' => [new ContactRule], + 'bcc.*' => [new ContactRule], 'variables' => 'sometimes|array', 'tags' => 'sometimes|array', 'metadata' => 'sometimes|array', @@ -68,9 +68,9 @@ public function rules(): array ], 'recipients.*.variables' => 'sometimes|array', 'recipients.*.cc' => 'sometimes|array', - 'recipients.*.cc.*' => [new ContactRule()], + 'recipients.*.cc.*' => [new ContactRule], 'recipients.*.bcc' => 'sometimes|array', - 'recipients.*.bcc.*' => [new ContactRule()], + 'recipients.*.bcc.*' => [new ContactRule], // Recipients attachments 'recipients.*.attachments' => 'sometimes|array', diff --git a/src/MailCarrierManager.php b/src/MailCarrierManager.php index 4fb0bd5..41d5124 100755 --- a/src/MailCarrierManager.php +++ b/src/MailCarrierManager.php @@ -118,7 +118,7 @@ public function upload(string $content, string $fileName): string ); if (!$uploadResponse) { - throw new UploadException(); + throw new UploadException; } return $filePath; diff --git a/src/MailCarrierServiceProvider.php b/src/MailCarrierServiceProvider.php index 494bd8b..1d6bb9c 100644 --- a/src/MailCarrierServiceProvider.php +++ b/src/MailCarrierServiceProvider.php @@ -74,7 +74,7 @@ public function packageRegistered(): void $this->app->register(\Laravel\Socialite\SocialiteServiceProvider::class); } - $this->app->scoped('mailcarrier', fn (): MailCarrierManager => new MailCarrierManager()); + $this->app->scoped('mailcarrier', fn (): MailCarrierManager => new MailCarrierManager); } /** diff --git a/src/Models/Casts/CastUsingJsonFlags.php b/src/Models/Casts/CastUsingJsonFlags.php index df4781f..4acec9a 100644 --- a/src/Models/Casts/CastUsingJsonFlags.php +++ b/src/Models/Casts/CastUsingJsonFlags.php @@ -10,6 +10,5 @@ class CastUsingJsonFlags public function __construct( public int $encode = 0, public int $decode = 0, - ) { - } + ) {} } diff --git a/src/Models/Casts/DataTransferObject.php b/src/Models/Casts/DataTransferObject.php index 50c94d4..785b157 100644 --- a/src/Models/Casts/DataTransferObject.php +++ b/src/Models/Casts/DataTransferObject.php @@ -57,6 +57,6 @@ protected function getJsonFlags(): CastUsingJsonFlags ->getAttributes(CastUsingJsonFlags::class); return ($attributes[0] ?? null)?->newInstance() - ?? new CastUsingJsonFlags(); + ?? new CastUsingJsonFlags; } } diff --git a/src/Resources/LogResource.php b/src/Resources/LogResource.php index 7b227a7..f490dcb 100644 --- a/src/Resources/LogResource.php +++ b/src/Resources/LogResource.php @@ -129,7 +129,7 @@ protected static function getTableFilters(): array ->preload(), Tables\Filters\SelectFilter::make('trigger') - ->options((new GetTriggers())->run()), + ->options((new GetTriggers)->run()), ]; } diff --git a/src/Resources/TemplateResource.php b/src/Resources/TemplateResource.php index 2834cd1..f4fb61a 100644 --- a/src/Resources/TemplateResource.php +++ b/src/Resources/TemplateResource.php @@ -68,7 +68,7 @@ public static function table(Tables\Table $table): Tables\Table $newRecord->fill([ 'user_id' => Auth::id(), 'name' => $name, - 'slug' => (new GenerateSlug())->run($name), + 'slug' => (new GenerateSlug)->run($name), ])->save(); redirect(TemplateResource::getUrl('edit', ['record' => $newRecord])); diff --git a/src/Resources/TemplateResource/Pages/CreateTemplate.php b/src/Resources/TemplateResource/Pages/CreateTemplate.php index 2cae33b..9af4e9c 100644 --- a/src/Resources/TemplateResource/Pages/CreateTemplate.php +++ b/src/Resources/TemplateResource/Pages/CreateTemplate.php @@ -19,7 +19,7 @@ protected function mutateFormDataBeforeCreate(array $data): array return [ ...$data, 'user_id' => Auth::id(), - 'slug' => (new GenerateSlug())->run($this->data['name']), + 'slug' => (new GenerateSlug)->run($this->data['name']), ]; } } diff --git a/src/Resources/UserResource/Actions/CreateAction.php b/src/Resources/UserResource/Actions/CreateAction.php index 9ee42ac..e32b028 100644 --- a/src/Resources/UserResource/Actions/CreateAction.php +++ b/src/Resources/UserResource/Actions/CreateAction.php @@ -51,7 +51,7 @@ protected function setUp(): void Forms\Components\TextInput::make('email') ->email() ->required() - ->unique((new User())->getTable(), 'email'), + ->unique((new User)->getTable(), 'email'), Forms\Components\TextInput::make('password') ->password()