forked from eatvio/eatvio-infra
make static-analyse code
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user