meeting the requirements of a static analyzer

This commit is contained in:
Anatoliy Poloz
2024-01-15 17:11:55 +03:00
81 changed files with 1320 additions and 501 deletions

View File

@@ -2,27 +2,17 @@
namespace App\Livewire\Chat;
use Livewire\Component;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Contracts\View\View;
use Livewire\Component;
class Tracker extends Component
{
public bool $showNewMessageNotifycation = false;
public int|bool $showNewMessageNotifycation = false;
public array $myMessages = [];
// Special Syntax: ['echo:{channel},{event}' => '{method}']
/**
* some Listeners
*
* @var array
*
* */
protected $listeners = ['echo:direct-chat,ChatMessageUpdated' => 'notifyNewMessage'];
public function notifyNewMessage(mixed $payload): void
public function notifyNewMessage(string $payload): void
{
$this->myMessages[] = $payload;
$this->showNewMessageNotifycation = true;
@@ -32,4 +22,9 @@ class Tracker extends Component
{
return view('livewire.chat.tracker');
}
protected function getListeners(): array
{
return ['echo:direct-chat,ChatMessageUpdated' => 'notifyNewMessage'];
}
}