forked from eatvio/eatvio-infra
make static analyse part
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user