Skip to content

Commit

Permalink
PHP CS Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
lochmueller committed Feb 10, 2024
1 parent 31dc70a commit c4688a1
Show file tree
Hide file tree
Showing 19 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion Classes/Controller/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion Classes/Controller/BookingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
34 changes: 17 additions & 17 deletions Classes/Controller/CalendarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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')) {
Expand Down Expand Up @@ -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')) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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']);
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Repository/EventRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
12 changes: 6 additions & 6 deletions Classes/Domain/Repository/IndexRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 [];
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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(
Expand Down
10 changes: 5 additions & 5 deletions Classes/Ical/VObjectEventAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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());
Expand All @@ -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();
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Classes/Property/TypeConverter/AbstractBookingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion Classes/Service/TcaService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 7 additions & 7 deletions Classes/Utility/DateTimeUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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());
Expand All @@ -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);
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion Classes/ViewHelpers/Link/AbstractActionViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions Classes/ViewHelpers/Link/AbstractLinkViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Classes/ViewHelpers/Loop/DaysInWeekViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Configuration/TCA/Overrides/sys_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

defined('TYPO3') or exit();

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
'calendarize',
'Configuration/TypoScript/',
'Calendarize'
Expand Down
6 changes: 3 additions & 3 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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),
Expand All @@ -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'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion Configuration/TCA/Overrides/tx_kesearch_indexerconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
'items' => [
0 => [
'label' => 'Default',
'value' => \HDNET\Calendarize\Domain\Model\PluginConfiguration::class,
'value' => HDNET\Calendarize\Domain\Model\PluginConfiguration::class,
],
],
],
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Build/PhpCsFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Build/FunctionalTestsBootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit c4688a1

Please sign in to comment.