mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 23:12:35 +00:00
Add phpstan level 7(#544)
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Web\Components;
|
||||
|
||||
use App\Models\User;
|
||||
use Filament\Pages\Page as BasePage;
|
||||
use Illuminate\View\ComponentAttributeBag;
|
||||
|
||||
@ -11,13 +12,19 @@ abstract class Page extends BasePage
|
||||
|
||||
protected ?string $live = '5s';
|
||||
|
||||
/**
|
||||
* @var array<string, mixed>
|
||||
*/
|
||||
protected array $extraAttributes = [];
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function getExtraAttributes(): array
|
||||
{
|
||||
$attributes = $this->extraAttributes;
|
||||
|
||||
if ($this->getLive()) {
|
||||
if (! in_array($this->getLive(), [null, '', '0'], true)) {
|
||||
$attributes['wire:poll.'.$this->getLive()] = '$dispatch(\'$refresh\')';
|
||||
}
|
||||
|
||||
@ -34,8 +41,19 @@ public function getLive(): ?string
|
||||
return $this->live;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, mixed>
|
||||
*/
|
||||
public function getWidgets(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
protected function getUser(): User
|
||||
{
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
|
||||
return $user;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user