Add phpstan level 7(#544)

This commit is contained in:
Saeed Vaziry
2025-03-12 13:31:10 +01:00
committed by GitHub
parent c22bb1fa80
commit 493cbb0849
437 changed files with 4505 additions and 2193 deletions

View File

@ -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;
}
}