make static-analyse code

This commit is contained in:
2024-01-15 01:05:10 +03:00
parent 57244b63be
commit bc2c8df9af
35 changed files with 221 additions and 182 deletions

View File

@@ -3,36 +3,39 @@
namespace App\Livewire\Diary;
use App\Models\ConsultantDiaryComment;
use App\Models\Diary;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Collection;
use Illuminate\View\View;
use Livewire\Component;
class ConsultantCommentsEdit extends Component
{
public $daysCount;
public int $daysCount;
public $diary;
public Diary $diary;
public $curMeals;
public array|Collection $curMeals = [];
public $typeNames;
public array $typeNames;
public $comments = [];
public array $comments = [];
public $retireComment = '';
public string $retireComment = '';
public $breakfastComment = '';
public string $breakfastComment = '';
public $dinnerComment = '';
public string $dinnerComment = '';
public $supperComment = '';
public string $supperComment = '';
public $lunchComment = '';
public string $lunchComment = '';
public $snacksComment = '';
public string $snacksComment = '';
public $totalComment = '';
public string $totalComment = '';
public function mount()
public function mount(): void
{
$this->comments = (new ConsultantDiaryComment())->where(
'user_id',
@@ -43,7 +46,7 @@ class ConsultantCommentsEdit extends Component
)->pluck('comment', 'comment_type')->toArray();
}
public function render()
public function render(): View
{
$commentTypes = ['breakfast', 'dinner', 'supper', 'lunch', 'snacks', 'wakeup_time', 'total'];
@@ -55,7 +58,7 @@ class ConsultantCommentsEdit extends Component
);
}
public function save()
public function save(): void
{
foreach ($this->comments as $key => $comment) {
$updateComment = ConsultantDiaryComment::updateOrCreate(