make static-analyse code

This commit is contained in:
2024-01-15 01:05:10 +03:00
parent 57244b63be
commit bc2c8df9af
35 changed files with 221 additions and 182 deletions

View File

@@ -3,23 +3,26 @@
namespace App\Livewire\Chat;
use Livewire\Component;
use Illuminate\View\View;
class Tracker extends Component
{
public $showNewMessageNotifycation = false;
public int|bool $showNewMessageNotifycation = false;
public $myMessages = [];
public array $myMessages = [];
// Special Syntax: ['echo:{channel},{event}' => '{method}']
protected $listeners = ['echo:direct-chat,ChatMessageUpdated' => 'notifyNewMessage'];
protected function getListeners(): array
{
return ['echo:direct-chat,ChatMessageUpdated' => 'notifyNewMessage'];
}
public function notifyNewMessage($payload): void
public function notifyNewMessage(string $payload): void
{
$this->myMessages[] = $payload;
$this->showNewMessageNotifycation = true;
}
public function render()
public function render(): View
{
return view('livewire.chat.tracker');
}