From 9f85717a00a08b50589d9ea2c8ec00a12decf3f9 Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Thu, 28 Sep 2023 11:14:56 +0200 Subject: [PATCH] Fix php stan --- packages/admin/src/Http/Livewire/Components/Products/Create.php | 2 +- packages/admin/src/Http/Livewire/Components/Products/Edit.php | 2 +- .../src/Http/Livewire/Components/Products/Form/Inventory.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/admin/src/Http/Livewire/Components/Products/Create.php b/packages/admin/src/Http/Livewire/Components/Products/Create.php index 04faf52d2..957b1f881 100644 --- a/packages/admin/src/Http/Livewire/Components/Products/Create.php +++ b/packages/admin/src/Http/Livewire/Components/Products/Create.php @@ -24,7 +24,7 @@ class Create extends AbstractBaseComponent use WithChoicesBrands; use WithSeoAttributes; - public ?Model $defaultChannel = null; + public $defaultChannel; public array $category_ids = []; diff --git a/packages/admin/src/Http/Livewire/Components/Products/Edit.php b/packages/admin/src/Http/Livewire/Components/Products/Edit.php index bdd5b2a85..3ae312f28 100644 --- a/packages/admin/src/Http/Livewire/Components/Products/Edit.php +++ b/packages/admin/src/Http/Livewire/Components/Products/Edit.php @@ -24,7 +24,7 @@ public function mount($product): void { $this->product = $product; $this->inventories = $inventories = Inventory::all(); - $this->inventory = $inventories->firstWhere('is_default', true)->id ?? $inventories->first()?->id; // @phpstan-ignore-line + $this->inventory = $inventories->firstWhere('is_default', true)->id ?? $inventories->first()?->id; } public function productHasUpdated(int $id): void diff --git a/packages/admin/src/Http/Livewire/Components/Products/Form/Inventory.php b/packages/admin/src/Http/Livewire/Components/Products/Form/Inventory.php index 7b210c828..87fcbbb90 100644 --- a/packages/admin/src/Http/Livewire/Components/Products/Form/Inventory.php +++ b/packages/admin/src/Http/Livewire/Components/Products/Form/Inventory.php @@ -21,7 +21,7 @@ class Inventory extends Component use WithPagination; use WithStock; - public ?Model $product = null; + public $product; public $inventories;