Skip to content

Commit

Permalink
[TASK] Avoid implicitly nullable class method parameter
Browse files Browse the repository at this point in the history
Closes #1244
  • Loading branch information
derhansen committed Sep 30, 2024
1 parent 42941fa commit 4706ba8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Classes/Controller/EventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ public function initializeSearchAction(): void
/**
* Search view
*/
public function searchAction(SearchDemand $searchDemand = null, array $overwriteDemand = []): ResponseInterface
public function searchAction(?SearchDemand $searchDemand = null, array $overwriteDemand = []): ResponseInterface
{
$eventDemand = EventDemand::createFromSettings($this->settings);
$eventDemand->setSearchDemand($searchDemand);
Expand Down
16 changes: 7 additions & 9 deletions Classes/Service/CalendarService.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ class CalendarService
{
/**
* Returns an array with weeks/days for the calendar view
*
* @param int $month
* @param int $year
* @param int $today
* @param int $firstDayOfWeek
* @param array|QueryResultInterface $events
* @return array
*/
public function getCalendarArray(int $month, int $year, int $today, int $firstDayOfWeek = 0, $events = null): array
{
public function getCalendarArray(
int $month,
int $year,
int $today,
int $firstDayOfWeek = 0,
array|QueryResultInterface|null $events = null
): array {
$weeks = [];
$dateRange = $this->getCalendarDateRange($month, $year, $firstDayOfWeek);
$currentDay = $dateRange['firstDayOfCalendar'];
Expand Down
4 changes: 2 additions & 2 deletions Classes/Service/EventEvaluationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private function evaluateSingleEventSetting(array $settings, ?Event $event = nul
* If no event is given and the isShortcut setting is set, the event is displayed using the "Insert Record"
* content element and should be loaded from contect object data
*/
private function evaluateIsShortcutSetting(RequestInterface $request, array $settings, ?Event $event): ?Event
private function evaluateIsShortcutSetting(RequestInterface $request, array $settings, ?Event $event = null): ?Event
{
if ($event === null && (bool)($settings['detail']['isShortcut'] ?? false)) {
$eventRawData = $request->getAttribute('currentContentObject')->data;
Expand All @@ -119,7 +119,7 @@ private function evaluateIsShortcutSetting(RequestInterface $request, array $set
/**
* If no event is given and the the `event_preview` argument is set, the event is displayed for preview
*/
private function evaluateEventPreviewSetting(RequestInterface $request, array $settings, ?Event $event): ?Event
private function evaluateEventPreviewSetting(RequestInterface $request, array $settings, ?Event $event = null): ?Event
{
if ($event === null && $request->hasArgument('event_preview')) {
$hasBackendUser = $this->context->getPropertyFromAspect('backend.user', 'isLoggedIn');
Expand Down

0 comments on commit 4706ba8

Please sign in to comment.