mirror of
https://github.com/pelican-dev/panel.git
synced 2026-05-04 18:00:48 +03:00
Remove unnecessary nullsafe operator on left side of ??
This commit is contained in:
@@ -39,7 +39,7 @@ class CreateSchedule extends CreateRecord
|
||||
$data['server_id'] = $server->id;
|
||||
}
|
||||
|
||||
$timezone = $data['timezone'] ?? user()?->timezone ?? 'UTC';
|
||||
$timezone = $data['timezone'] ?? user()->timezone ?? 'UTC';
|
||||
unset($data['timezone']);
|
||||
|
||||
if (!isset($data['next_run_at'])) {
|
||||
|
||||
@@ -37,7 +37,7 @@ class EditSchedule extends EditRecord
|
||||
|
||||
protected function mutateFormDataBeforeSave(array $data): array
|
||||
{
|
||||
$timezone = $data['timezone'] ?? user()?->timezone ?? 'UTC';
|
||||
$timezone = $data['timezone'] ?? user()->timezone ?? 'UTC';
|
||||
unset($data['timezone']);
|
||||
|
||||
$data['next_run_at'] = ScheduleResource::getNextRun(
|
||||
|
||||
@@ -100,7 +100,7 @@ class ScheduleResource extends Resource
|
||||
Section::make('Cron')
|
||||
->label(trans('server/schedule.cron'))
|
||||
->description(function (Get $get) {
|
||||
$timezone = $get('timezone') ?? user()?->timezone ?? 'UTC';
|
||||
$timezone = $get('timezone') ?? user()->timezone ?? 'UTC';
|
||||
|
||||
try {
|
||||
$nextRun = Utilities::getScheduleNextRunDate($get('cron_minute'), $get('cron_hour'), $get('cron_day_of_month'), $get('cron_month'), $get('cron_day_of_week'), $timezone)->timezone($timezone);
|
||||
@@ -300,7 +300,7 @@ class ScheduleResource extends Resource
|
||||
Select::make('timezone')
|
||||
->label(trans('server/schedule.timezone'))
|
||||
->options(fn () => array_combine(timezone_identifiers_list(), timezone_identifiers_list()))
|
||||
->default(user()?->timezone ?? 'UTC')
|
||||
->default(user()->timezone ?? 'UTC')
|
||||
->searchable()
|
||||
->live()
|
||||
->hiddenOn('view'),
|
||||
|
||||
@@ -75,7 +75,7 @@ class ScheduleController extends ClientApiController
|
||||
'cron_minute' => $request->input('minute'),
|
||||
'is_active' => (bool) $request->input('is_active'),
|
||||
'only_when_online' => (bool) $request->input('only_when_online'),
|
||||
'next_run_at' => $this->getNextRunAt($request, $request->user()?->timezone ?? 'UTC'),
|
||||
'next_run_at' => $this->getNextRunAt($request, $request->user()->timezone ?? 'UTC'),
|
||||
]);
|
||||
|
||||
Activity::event('server:schedule.create')
|
||||
@@ -131,7 +131,7 @@ class ScheduleController extends ClientApiController
|
||||
'cron_minute' => $request->input('minute'),
|
||||
'is_active' => $active,
|
||||
'only_when_online' => (bool) $request->input('only_when_online'),
|
||||
'next_run_at' => $this->getNextRunAt($request, $request->user()?->timezone ?? 'UTC'),
|
||||
'next_run_at' => $this->getNextRunAt($request, $request->user()->timezone ?? 'UTC'),
|
||||
];
|
||||
|
||||
// Toggle the processing state of the scheduled task when it is enabled or disabled so that an
|
||||
|
||||
Reference in New Issue
Block a user