Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
danilopolani committed Feb 20, 2024
1 parent 66e59d6 commit 4b8e18d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/Dto/AttachmentDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@

class AttachmentDto
{
public static function fromUploadedFile(UploadedFile $file): static
public static function fromUploadedFile(UploadedFile $file): self
{
return new static(
return new self(
name: $file->getClientOriginalName(),
content: base64_encode($file->getContent()),
size: $file->getSize(),
);
}

/**
* @param string $content Base64 encoded file content
* @param string $content Base64 encoded file content
*/
public function __construct(
public readonly string $name,
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/MailCarrierController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function send(SendMailRequest $request, SendMail $sendMail): JsonResponse
...$recipient,
'attachments' => Collection::make($request->file("recipients.{$i}.attachments"))
->map(fn (UploadedFile $file) => AttachmentDto::fromUploadedFile($file))
->all()
->all(),
])
->all(),
'attachments' => Collection::make($request->file('attachments'))
Expand Down
19 changes: 10 additions & 9 deletions src/Resources/LogResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ protected static function getTableActions(): array
])
->modalWidth('2xl')
->modalIcon('heroicon-o-arrow-path')
->modalDescription(fn (Log $record) =>
$record->isFailed()
->modalDescription(
fn (Log $record) => $record->isFailed()
? 'Are you sure you want to manually retry to send this email?'
: 'Are you sure you want to to send again this email?'
)
Expand Down Expand Up @@ -231,13 +231,14 @@ protected static function resendEmail(Log $log, array $data): void
'tags' => $log->tags ?: [],
'metadata' => $log->metadata ?: [],
'attachments' => $log->attachments
->map(fn (Attachment $attachment) => !$attachment->canBeDownloaded()
? null
: new AttachmentDto(
name: $attachment->name,
content: $attachment->content,
size: $attachment->size
)
->map(
fn (Attachment $attachment) => !$attachment->canBeDownloaded()
? null
: new AttachmentDto(
name: $attachment->name,
content: $attachment->content,
size: $attachment->size
)
)
->filter()
->merge(
Expand Down

0 comments on commit 4b8e18d

Please sign in to comment.