diff --git a/Classes/Controller/BackendController.php b/Classes/Controller/BackendController.php index e964eade..0e3fe10b 100644 --- a/Classes/Controller/BackendController.php +++ b/Classes/Controller/BackendController.php @@ -58,7 +58,7 @@ public function initializeListAction(): void /** * Basic backend list. */ - public function listAction(OptionRequest $options = null, int $currentPage = 1): ResponseInterface + public function listAction(?OptionRequest $options = null, int $currentPage = 1): ResponseInterface { if (null === $options) { $options = $this->getOptions(); diff --git a/Classes/Controller/BookingController.php b/Classes/Controller/BookingController.php index db4800be..3aa1c4f9 100644 --- a/Classes/Controller/BookingController.php +++ b/Classes/Controller/BookingController.php @@ -18,7 +18,7 @@ class BookingController extends AbstractController /** * Form action. */ - public function bookingAction(Index $index = null): ResponseInterface + public function bookingAction(?Index $index = null): ResponseInterface { $this->view->assign('index', $index); diff --git a/Classes/Controller/CalendarController.php b/Classes/Controller/CalendarController.php index c3bfc114..eae47edc 100644 --- a/Classes/Controller/CalendarController.php +++ b/Classes/Controller/CalendarController.php @@ -119,9 +119,9 @@ protected function redirectDetailWithEvent(): ?ResponseInterface #[Extbase\IgnoreValidation(['argumentName' => 'endDate'])] #[Extbase\IgnoreValidation(['argumentName' => 'customSearch'])] public function latestAction( - Index $index = null, - \DateTime $startDate = null, - \DateTime $endDate = null, + ?Index $index = null, + ?\DateTime $startDate = null, + ?\DateTime $endDate = null, array $customSearch = [], int $year = 0, int $month = 0, @@ -160,9 +160,9 @@ public function latestAction( #[Extbase\IgnoreValidation(['argumentName' => 'endDate'])] #[Extbase\IgnoreValidation(['argumentName' => 'customSearch'])] public function resultAction( - Index $index = null, - \DateTime $startDate = null, - \DateTime $endDate = null, + ?Index $index = null, + ?\DateTime $startDate = null, + ?\DateTime $endDate = null, array $customSearch = [], int $year = 0, int $month = 0, @@ -201,9 +201,9 @@ public function resultAction( #[Extbase\IgnoreValidation(['argumentName' => 'endDate'])] #[Extbase\IgnoreValidation(['argumentName' => 'customSearch'])] public function listAction( - Index $index = null, - \DateTime $startDate = null, - \DateTime $endDate = null, + ?Index $index = null, + ?\DateTime $startDate = null, + ?\DateTime $endDate = null, array $customSearch = [], int $year = 0, int $month = 0, @@ -336,7 +336,7 @@ public function yearAction(int $year = 0): ResponseInterface * * @return ResponseInterface */ - public function quarterAction(int $year = 0, int $quarter = null): ResponseInterface + public function quarterAction(int $year = 0, ?int $quarter = null): ResponseInterface { if ($this->request->hasArgument('format')) { if ('html' != $this->request->getArgument('format')) { @@ -415,7 +415,7 @@ public function monthAction(int $year = 0, int $month = 0, int $day = 0): Respon /** * Week action. */ - public function weekAction(int $year = null, int $week = null): ResponseInterface + public function weekAction(?int $year = null, ?int $week = null): ResponseInterface { if ($this->request->hasArgument('format')) { if ('html' != $this->request->getArgument('format')) { @@ -514,7 +514,7 @@ public function dayAction(int $year = 0, int $month = 0, int $day = 0): Response /** * Detail action. */ - public function detailAction(Index $index = null): ResponseInterface + public function detailAction(?Index $index = null): ResponseInterface { $redirectResponse = $this->redirectDetailWithEvent(); if ($redirectResponse) { @@ -602,8 +602,8 @@ public function detailAction(Index $index = null): ResponseInterface #[Extbase\IgnoreValidation(['argumentName' => 'endDate'])] #[Extbase\IgnoreValidation(['argumentName' => 'customSearch'])] public function searchAction( - \DateTime $startDate = null, - \DateTime $endDate = null, + ?\DateTime $startDate = null, + ?\DateTime $endDate = null, array $customSearch = [] ): ResponseInterface { $this->addCacheTags(['calendarize_search']); @@ -670,8 +670,8 @@ public function singleAction(): ResponseInterface * Build the search structure. */ protected function determineSearch( - \DateTime $startDate = null, - \DateTime $endDate = null, + ?\DateTime $startDate = null, + ?\DateTime $endDate = null, array $customSearch = [], int $year = 0, int $month = 0, @@ -748,7 +748,7 @@ protected function determineSearch( return $event->getVariables(); } - protected function checkWrongDateOrder(\DateTime $startDate = null, \DateTime &$endDate = null): array + protected function checkWrongDateOrder(?\DateTime $startDate = null, ?\DateTime &$endDate = null): array { if ($startDate && $endDate && $endDate < $startDate) { // End date is before start date. So use start and end equals! diff --git a/Classes/Domain/Repository/EventRepository.php b/Classes/Domain/Repository/EventRepository.php index 54cb8056..da7dc7b1 100644 --- a/Classes/Domain/Repository/EventRepository.php +++ b/Classes/Domain/Repository/EventRepository.php @@ -49,7 +49,7 @@ public function findBySearch(Search $search): array return array_map(static fn ($row) => (int)($row['_LOCALIZED_UID'] ?? $row['uid']), $rows); } - public function findOneByImportId(string $importId, int $pid = null): ?object + public function findOneByImportId(string $importId, ?int $pid = null): ?object { $query = $this->createQuery(); diff --git a/Classes/Domain/Repository/IndexRepository.php b/Classes/Domain/Repository/IndexRepository.php index 1ccae4d9..17477398 100644 --- a/Classes/Domain/Repository/IndexRepository.php +++ b/Classes/Domain/Repository/IndexRepository.php @@ -184,8 +184,8 @@ public function findList( * Find by custom search. */ public function findBySearch( - \DateTimeInterface $startDate = null, - \DateTimeInterface $endDate = null, + ?\DateTimeInterface $startDate = null, + ?\DateTimeInterface $endDate = null, array $customSearch = [], int $limit = 0 ): array|QueryResultInterface { @@ -309,7 +309,7 @@ public function findByTableAndUid( bool $past = false, int $limit = 100, string $sort = QueryInterface::ORDER_ASCENDING, - \DateTimeImmutable $referenceDate = null + ?\DateTimeImmutable $referenceDate = null ): array|QueryResultInterface { if (!$future && !$past) { return []; @@ -455,7 +455,7 @@ public function setDefaultSortingDirection(string $direction, string $field = '' */ public function findByTimeSlot( ?\DateTimeInterface $startTime, - \DateTimeInterface $endTime = null + ?\DateTimeInterface $endTime = null ): array|QueryResultInterface { $query = $this->createQuery(); $constraints = $this->getDefaultConstraints($query); @@ -538,8 +538,8 @@ protected function getDefaultConstraints(QueryInterface $query): array protected function addTimeFrameConstraints( array &$constraints, QueryInterface $query, - \DateTimeInterface $startTime = null, - \DateTimeInterface $endTime = null + ?\DateTimeInterface $startTime = null, + ?\DateTimeInterface $endTime = null ): void { /** @var AddTimeFrameConstraintsEvent $event */ $event = $this->eventDispatcher->dispatch(new AddTimeFrameConstraintsEvent( diff --git a/Classes/Ical/VObjectEventAdapter.php b/Classes/Ical/VObjectEventAdapter.php index ab7c56ad..f22a9471 100644 --- a/Classes/Ical/VObjectEventAdapter.php +++ b/Classes/Ical/VObjectEventAdapter.php @@ -143,13 +143,13 @@ public function getEndDate(): ?\DateTime protected function getEndDateTime(): ?\DateTimeImmutable { if (isset($this->event->DTEND)) { - /** @var \Sabre\VObject\Property\ICalendar\DateTime $dtEnd */ + /** @var Property\ICalendar\DateTime $dtEnd */ $dtEnd = $this->event->DTEND; return $dtEnd->getDateTime(); } if (isset($this->event->DURATION)) { - /** @var \Sabre\VObject\Property\ICalendar\DateTime $dtStart */ + /** @var Property\ICalendar\DateTime $dtStart */ $dtStart = $this->event->DTSTART; $duration = $this->event->DURATION->getDateInterval(); @@ -168,7 +168,7 @@ public function getStartTime(): int return self::ALLDAY_START_TIME; } - /** @var \Sabre\VObject\Property\ICalendar\DateTime $start */ + /** @var Property\ICalendar\DateTime $start */ $start = $this->event->DTSTART; return DateTimeUtility::getNormalizedDaySecondsOfDateTime($start->getDateTime()); @@ -195,7 +195,7 @@ public function isAllDay(): bool if (!isset($this->event->DTSTART)) { return true; } - /** @var \Sabre\VObject\Property\ICalendar\DateTime $start */ + /** @var Property\ICalendar\DateTime $start */ $start = $this->event->DTSTART; return !$start->hasTime(); @@ -234,7 +234,7 @@ public function getRRule(): array } $rrule = $this->event->RRULE->getValue(); if (\is_string($rrule)) { - $rrule = \Sabre\VObject\Property\ICalendar\Recur::stringToArray($rrule); + $rrule = Property\ICalendar\Recur::stringToArray($rrule); } return $rrule; diff --git a/Classes/Property/TypeConverter/AbstractBookingRequest.php b/Classes/Property/TypeConverter/AbstractBookingRequest.php index ec04fd15..a76f42be 100644 --- a/Classes/Property/TypeConverter/AbstractBookingRequest.php +++ b/Classes/Property/TypeConverter/AbstractBookingRequest.php @@ -69,7 +69,7 @@ public function convertFrom( $source, string $targetType, array $convertedChildProperties = [], - PropertyMappingConfigurationInterface $configuration = null + ?PropertyMappingConfigurationInterface $configuration = null ) { $bookingRequest = $this->getBookingRequestModel(); foreach ($source as $key => $value) { diff --git a/Classes/Service/TcaService.php b/Classes/Service/TcaService.php index c52c33ba..a781a5f2 100644 --- a/Classes/Service/TcaService.php +++ b/Classes/Service/TcaService.php @@ -19,7 +19,7 @@ class TcaService extends AbstractService /** * Render the configuration title. */ - public function configurationTitle(array &$params, object $_ = null): void + public function configurationTitle(array &$params, ?object $_ = null): void { $row = $params['row']; $this->migrateFormEngineRow($row); diff --git a/Classes/Utility/DateTimeUtility.php b/Classes/Utility/DateTimeUtility.php index 58b8ed7b..78d79640 100644 --- a/Classes/Utility/DateTimeUtility.php +++ b/Classes/Utility/DateTimeUtility.php @@ -118,9 +118,9 @@ public static function setSecondsOfDateTime(\DateTime $date, int $seconds): \Dat * Get a normalize date time object. */ public static function normalizeDateTime( - int $day = null, - int $month = null, - int $year = null + ?int $day = null, + ?int $month = null, + ?int $year = null ): \DateTime { $date = self::getNow(); // Check if this date should handle always in UTC @@ -148,7 +148,7 @@ public static function normalizeDateTime( /** * Normalize quarter. */ - public static function normalizeQuarter(int $quarter = null): int + public static function normalizeQuarter(?int $quarter = null): int { if (null === $quarter) { $quarter = self::getQuarter(self::getNow()); @@ -170,7 +170,7 @@ public static function getQuarter(\DateTimeInterface $date): int /** * Reset the DateTime. */ - public static function resetTime(string|\DateTimeInterface $dateTime = null): \DateTime + public static function resetTime(string|\DateTimeInterface|null $dateTime = null): \DateTime { $dateTime = self::normalizeDateTimeSingle($dateTime); $dateTime->setTime(0, 0); @@ -184,8 +184,8 @@ public static function resetTime(string|\DateTimeInterface $dateTime = null): \D * @throws \Exception */ public static function normalizeDateTimeSingle( - int|string|\DateTimeInterface $dateInformation = null, - \DateTimeZone $timezone = null + int|string|\DateTimeInterface|null $dateInformation = null, + ?\DateTimeZone $timezone = null ): \DateTime { $timezone = $timezone ?? self::getTimeZone(); $date = self::getNow(); diff --git a/Classes/ViewHelpers/Link/AbstractActionViewHelper.php b/Classes/ViewHelpers/Link/AbstractActionViewHelper.php index 73fa1e65..35989bb7 100644 --- a/Classes/ViewHelpers/Link/AbstractActionViewHelper.php +++ b/Classes/ViewHelpers/Link/AbstractActionViewHelper.php @@ -27,7 +27,7 @@ public function initializeArguments(): void /** * Render a link with action and controller. */ - public function renderExtbaseLink(array $controllerArguments = [], int $pageUid = null): string + public function renderExtbaseLink(array $controllerArguments = [], ?int $pageUid = null): string { $absolute = $this->arguments['absolute'] ?? false; $pageUid = $pageUid ?? $this->getPageUid((int)($this->arguments['pageUid'] ?? 0)); diff --git a/Classes/ViewHelpers/Link/AbstractLinkViewHelper.php b/Classes/ViewHelpers/Link/AbstractLinkViewHelper.php index 5675e37a..cd160cec 100644 --- a/Classes/ViewHelpers/Link/AbstractLinkViewHelper.php +++ b/Classes/ViewHelpers/Link/AbstractLinkViewHelper.php @@ -48,7 +48,7 @@ public function initializeArguments(): void * Render the link. */ public function renderLink( - int $pageUid = null, + ?int $pageUid = null, array $additionalParams = [], bool $absolute = false, $section = '' @@ -76,7 +76,7 @@ public function renderLink( /** * Get the right page Uid. */ - protected function getPageUid(int $pageUid, string $contextName = null): int + protected function getPageUid(int $pageUid, ?string $contextName = null): int { if (MathUtility::canBeInterpretedAsInteger($pageUid) && $pageUid > 0) { return $pageUid; diff --git a/Classes/ViewHelpers/Loop/DaysInWeekViewHelper.php b/Classes/ViewHelpers/Loop/DaysInWeekViewHelper.php index 5a12cc03..91d3ee7c 100644 --- a/Classes/ViewHelpers/Loop/DaysInWeekViewHelper.php +++ b/Classes/ViewHelpers/Loop/DaysInWeekViewHelper.php @@ -29,7 +29,7 @@ public function initializeArguments(): void * * @return array */ - protected function getItems(\DateTime $date, \DateTime $originalDate = null): array + protected function getItems(\DateTime $date, ?\DateTime $originalDate = null): array { if (null === $originalDate) { $originalDate = clone $date; diff --git a/Configuration/TCA/Overrides/sys_template.php b/Configuration/TCA/Overrides/sys_template.php index 308c925d..cf1635fe 100644 --- a/Configuration/TCA/Overrides/sys_template.php +++ b/Configuration/TCA/Overrides/sys_template.php @@ -4,7 +4,7 @@ defined('TYPO3') or exit(); -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile( +TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile( 'calendarize', 'Configuration/TypoScript/', 'Calendarize' diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index cde8fa53..e2ebf857 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -7,7 +7,7 @@ $ll = 'LLL:EXT:calendarize/Resources/Private/Language/locallang.xlf:'; foreach (['normal', 'special', 'booking'] as $itemGroup) { - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItemGroup( + TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItemGroup( 'tt_content', 'list_type', 'calendarize_' . $itemGroup, @@ -28,7 +28,7 @@ ); foreach ($pluginNameAndGroup as $name => $group) { - $pluginSignature = \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + $pluginSignature = TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( 'calendarize', $name, $ll . 'mode.' . strtolower($name), @@ -40,7 +40,7 @@ // Activate the display of the plug-in flexform field and set FlexForm definition $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( + TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( $pluginSignature, 'FILE:EXT:calendarize/Configuration/FlexForms/Calendar.xml' ); diff --git a/Configuration/TCA/Overrides/tx_calendarize_domain_model_event.php b/Configuration/TCA/Overrides/tx_calendarize_domain_model_event.php index 8fd5b0b3..d3206499 100644 --- a/Configuration/TCA/Overrides/tx_calendarize_domain_model_event.php +++ b/Configuration/TCA/Overrides/tx_calendarize_domain_model_event.php @@ -8,8 +8,8 @@ Register::createTcaConfiguration(Register::getDefaultCalendarizeConfiguration()); -if (!\HDNET\Calendarize\Utility\ConfigurationUtility::get('disableDefaultEvent')) { - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToInsertRecords('tx_calendarize_domain_model_event'); +if (!HDNET\Calendarize\Utility\ConfigurationUtility::get('disableDefaultEvent')) { + TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToInsertRecords('tx_calendarize_domain_model_event'); } else { $GLOBALS['TCA']['tx_calendarize_domain_model_event']['ctrl']['hideTable'] = true; } diff --git a/Configuration/TCA/Overrides/tx_kesearch_indexerconfig.php b/Configuration/TCA/Overrides/tx_kesearch_indexerconfig.php index 41d4ff27..bd9b0105 100644 --- a/Configuration/TCA/Overrides/tx_kesearch_indexerconfig.php +++ b/Configuration/TCA/Overrides/tx_kesearch_indexerconfig.php @@ -4,6 +4,6 @@ defined('TYPO3') or exit(); -if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ke_search')) { +if (TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ke_search')) { $GLOBALS['TCA']['tx_kesearch_indexerconfig']['columns']['sysfolder']['displayCond'] .= ',calendarize'; } diff --git a/Configuration/TCA/tx_calendarize_domain_model_pluginconfiguration.php b/Configuration/TCA/tx_calendarize_domain_model_pluginconfiguration.php index 1d590af9..36ed3158 100644 --- a/Configuration/TCA/tx_calendarize_domain_model_pluginconfiguration.php +++ b/Configuration/TCA/tx_calendarize_domain_model_pluginconfiguration.php @@ -140,7 +140,7 @@ 'items' => [ 0 => [ 'label' => 'Default', - 'value' => \HDNET\Calendarize\Domain\Model\PluginConfiguration::class, + 'value' => HDNET\Calendarize\Domain\Model\PluginConfiguration::class, ], ], ], diff --git a/Resources/Private/Build/PhpCsFixer.php b/Resources/Private/Build/PhpCsFixer.php index 21d4738d..c24528c9 100644 --- a/Resources/Private/Build/PhpCsFixer.php +++ b/Resources/Private/Build/PhpCsFixer.php @@ -14,7 +14,7 @@ ->in($baseDir . '/Configuration/TCA') ->in($baseDir . '/Resources/Private/Build'); -$config = new \PhpCsFixer\Config(); +$config = new PhpCsFixer\Config(); return $config ->setRiskyAllowed(true) diff --git a/Tests/Functional/Build/FunctionalTestsBootstrap.php b/Tests/Functional/Build/FunctionalTestsBootstrap.php index 443197d7..5f665cb5 100644 --- a/Tests/Functional/Build/FunctionalTestsBootstrap.php +++ b/Tests/Functional/Build/FunctionalTestsBootstrap.php @@ -13,7 +13,7 @@ */ call_user_func(function () { - $testbase = new \TYPO3\TestingFramework\Core\Testbase(); + $testbase = new TYPO3\TestingFramework\Core\Testbase(); $testbase->defineOriginalRootPath(); $testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/tests'); $testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/transient');