Skip to content

Commit

Permalink
chore: Static analysis errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lewislarsen committed Jul 14, 2024
1 parent c317a86 commit b15f66f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/Livewire/BackupTasks/Modals/LogModal.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use App\Models\BackupTask;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
use Livewire\Attributes\On;
use Livewire\Component;

Expand All @@ -16,14 +17,19 @@ class LogModal extends Component
public bool $isStreaming = false;
public bool $isLoading = true;

public function mount($backupTask): void
public function mount(BackupTask|int $backupTask): void
{
$this->backupTaskId = $backupTask instanceof BackupTask ? $backupTask->id : $backupTask;
$this->backupTaskId = $backupTask instanceof BackupTask ? $backupTask->getAttribute('id') : $backupTask;
$this->loadLatestLog();
}

/**
* Handle the stream event.
*
* @param array{logOutput: string} $event
*/
#[On('echo:backup-task-log.{backupTaskId},StreamBackupTaskLogEvent')]
public function handleStreamEvent($event): void
public function handleStreamEvent(array $event): void
{
Log::debug('LogModal: Received StreamBackupTaskLogEvent', ['event' => $event, 'componentId' => $this->getId()]);

Expand All @@ -37,7 +43,7 @@ public function refresh(): void
$this->loadLatestLog();
}

public function render()
public function render(): View
{
return view('livewire.backup-tasks.modals.log-modal', [
'backupTask' => BackupTask::find($this->backupTaskId),
Expand Down

0 comments on commit b15f66f

Please sign in to comment.