make static analyse part

This commit is contained in:
2024-01-14 13:11:41 +03:00
parent 5e24ef3555
commit 38666bd460
29 changed files with 152 additions and 240 deletions

View File

@@ -11,19 +11,19 @@ use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
class CalendarController extends Controller
{
public $weekStartsAt;
public int $weekStartsAt;
public $weekEndsAt;
public int $weekEndsAt;
public $startsAt;
public Carbon $startsAt;
public $endsAt;
public Carbon $endsAt;
public $gridStartsAt;
public Carbon $gridStartsAt;
public $gridEndsAt;
public Carbon $gridEndsAt;
public function __construct($initialYear = null, $initialMonth = null, $weekStartsAt = null)
public function __construct(int $initialYear = null, int $initialMonth = null, int $weekStartsAt = null)
{
$this->weekStartsAt = $weekStartsAt ?? Carbon::MONDAY;
$this->weekEndsAt = $this->weekStartsAt === Carbon::MONDAY
@@ -38,7 +38,7 @@ class CalendarController extends Controller
$this->calculateGridStartsEnds();
}
public function calculateGridStartsEnds()
public function calculateGridStartsEnds(): void
{
$this->gridStartsAt = $this->startsAt->clone()->startOfWeek($this->weekStartsAt);
$this->gridEndsAt = $this->endsAt->clone()->endOfWeek($this->weekEndsAt);
@@ -53,7 +53,7 @@ class CalendarController extends Controller
$this->gridEndsAt
);
$filledDays = Diary::where('user_id', $curUser->id)
->whereMonth('date', now()->month)
->whereMonth('date', (string) now()->month)
->get()
->keyBy('date');