Skip to content

Commit

Permalink
phpcs.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterMis committed Aug 4, 2023
1 parent d7a729e commit b07a503
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions lib/Controller/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,12 @@ public function eventData(Request $request, Response $response)
$toDt = Carbon::createFromTimestamp($scheduleEvent->toDt);

// Set the row from/to date to be an ISO date for display
$scheduleEvent->fromDt = Carbon::createFromTimestamp($scheduleEvent->fromDt)->format(DateFormatHelper::getSystemFormat());
$scheduleEvent->toDt = Carbon::createFromTimestamp($scheduleEvent->toDt)->format(DateFormatHelper::getSystemFormat());
$scheduleEvent->fromDt =
Carbon::createFromTimestamp($scheduleEvent->fromDt)
->format(DateFormatHelper::getSystemFormat());
$scheduleEvent->toDt =
Carbon::createFromTimestamp($scheduleEvent->toDt)
->format(DateFormatHelper::getSystemFormat());

$this->getLog()->debug(sprintf('Start date is ' . $fromDt->toRssString() . ' ' . $scheduleEvent->fromDt));
$this->getLog()->debug(sprintf('End date is ' . $toDt->toRssString() . ' ' . $scheduleEvent->toDt));
Expand Down Expand Up @@ -525,7 +529,12 @@ public function eventList(Request $request, Response $response, $id)
// Reset the seconds
$date->second(0);

$this->getLog()->debug(sprintf('Generating eventList for DisplayGroupId ' . $id . ' on date ' . $date->format(DateFormatHelper::getSystemFormat())));
$this->getLog()->debug(
sprintf(
'Generating eventList for DisplayGroupId ' . $id . ' on date '
. $date->format(DateFormatHelper::getSystemFormat())
)
);

// Get a list of scheduled events
$events = [];
Expand Down Expand Up @@ -799,7 +808,7 @@ private function calculateIntermediates($display, $displayGroup, $eventDisplayGr
* @throws InvalidArgumentException
* @throws NotFoundException
*/
function addForm(Request $request, Response $response, ?string $from, ?int $id): Response|ResponseInterface
public function addForm(Request $request, Response $response, ?string $from, ?int $id): Response|ResponseInterface
{
// Get the display groups added to the session (if there are some)
$displayGroupIds = $this->session->get('displayGroupIds');
Expand Down Expand Up @@ -1179,9 +1188,12 @@ public function add(Request $request, Response $response)
throw new InvalidArgumentException(__('Please enter a from date'), 'fromDt');
}

$logToDt = isset($toDt) ? $toDt->format(DateFormatHelper::getSystemFormat()) : null;
$logRecurrenceRange = isset($recurrenceRange) ? $recurrenceRange->format(DateFormatHelper::getSystemFormat()) : null;
$this->getLog()->debug('Times received are: FromDt=' . $fromDt->format(DateFormatHelper::getSystemFormat()) . '. ToDt=' . $logToDt . '. recurrenceRange=' . $logRecurrenceRange);
$logToDt = $toDt?->format(DateFormatHelper::getSystemFormat());
$logRecurrenceRange = $recurrenceRange?->format(DateFormatHelper::getSystemFormat());
$this->getLog()->debug(
'Times received are: FromDt=' . $fromDt->format(DateFormatHelper::getSystemFormat())
. '. ToDt=' . $logToDt . '. recurrenceRange=' . $logRecurrenceRange
);

if (!$schedule->isCustomDayPart() && !$schedule->isAlwaysDayPart()) {
// Daypart selected
Expand Down

0 comments on commit b07a503

Please sign in to comment.