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

@@ -23,7 +23,7 @@ class MealForm extends Component
public array $portions;
public int $quantity;
public string $quantity;
public array $pcs;
@@ -43,11 +43,6 @@ class MealForm extends Component
'portion' => 'required|min:1',
];
/**
* @var array
*/
protected $listeners = ['food-intake-updated' => '$refresh'];
public function mount(): void
{
$this->diary = Diary::find($this->diaryId);
@@ -191,6 +186,11 @@ class MealForm extends Component
$this->portions = array_values($filtered);
}
protected function getListeners(): array
{
return ['food-intake-updated' => '$refresh'];
}
private function addPortionIfItFilled(): void
{
if (mb_strlen($this->product_name) && $this->quantity && mb_strlen($this->portion)) {