Skip to content

Commit

Permalink
chore: PHP CS Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
lochmueller committed Jan 24, 2025
1 parent 836862c commit ac9e593
Show file tree
Hide file tree
Showing 95 changed files with 311 additions and 373 deletions.
10 changes: 5 additions & 5 deletions Classes/Command/CleanupCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(
protected EventDispatcherInterface $eventDispatcher,
protected RawIndexRepository $rawIndexRepository,
protected IndexerService $indexerService,
protected DataMapper $dataMapper
protected DataMapper $dataMapper,
) {
parent::__construct();
}
Expand All @@ -49,26 +49,26 @@ protected function configure()
'r',
InputOption::VALUE_REQUIRED,
'The repository of the event to clean up',
self::DEFAULT_CLEANUP_REPOSITORY
self::DEFAULT_CLEANUP_REPOSITORY,
)
->addOption(
'modus',
'm',
InputOption::VALUE_REQUIRED,
'What to do with cleaned Events? Set them \'hide\' or \'delete\'',
self::MODE_HIDDEN
self::MODE_HIDDEN,
)
->addOption(
'waitingPeriod',
'w',
InputOption::VALUE_REQUIRED,
'How many days to wait after ending the Event before \'hide/delete\' it',
self::DEFAULT_WAIT_PERIOD
self::DEFAULT_WAIT_PERIOD,
)->addOption(
'dry-run',
null,
InputOption::VALUE_NONE,
'If this option is set, it only outputs the amount of records which would have been updated'
'If this option is set, it only outputs the amount of records which would have been updated',
);
}

Expand Down
8 changes: 4 additions & 4 deletions Classes/Command/ImportCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(
protected ICalServiceInterface $iCalService,
protected EventDispatcherInterface $eventDispatcher,
protected IndexerService $indexerService,
protected ICalUrlService $iCalUrlService
protected ICalUrlService $iCalUrlService,
) {
parent::__construct();
}
Expand All @@ -39,20 +39,20 @@ protected function configure()
->addArgument(
'icsCalendarUri',
InputArgument::REQUIRED,
'The URL of the iCalendar ICS or local file (t3://file?uid=23)'
'The URL of the iCalendar ICS or local file (t3://file?uid=23)',
)
->addArgument(
'pid',
InputArgument::REQUIRED,
'The page ID to create new elements'
'The page ID to create new elements',
)
->addOption(
'since',
's',
InputOption::VALUE_OPTIONAL,
'Imports all events since the given date.' . \chr(10)
. 'Valid PHP date format e.g. "2014-04-14", "-10 days"' . \chr(10)
. '(Note: use --since="-x days" syntax on the console)'
. '(Note: use --since="-x days" syntax on the console)',
);
}

Expand Down
24 changes: 12 additions & 12 deletions Classes/Controller/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function injectConfigurationManager(ConfigurationManagerInterface $config
{
$this->configurationManager = $configurationManager;
$this->settings = $this->configurationManager->getConfiguration(
ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS
ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS,
);
$this->settings = $this->pluginConfigurationService->respectPluginConfiguration($this->settings);
$this->arguments = GeneralUtility::makeInstance(Arguments::class);
Expand All @@ -81,15 +81,15 @@ public function initializeAction(): void
$this->arguments,
$this->settings,
static::class,
$this->actionMethodName
$this->actionMethodName,
);
$this->eventDispatcher->dispatch($event);
$this->request = $event->getRequest();
$this->arguments = $event->getArguments();
$this->settings = $event->getSettings();

AbstractBookingRequest::setConfigurations(
GeneralUtility::trimExplode(',', $this->settings['configuration'] ?? '')
GeneralUtility::trimExplode(',', $this->settings['configuration'] ?? ''),
);
}

Expand All @@ -100,7 +100,7 @@ protected function initializeView(): void
$this->arguments,
$this->settings,
static::class,
$this->actionMethodName
$this->actionMethodName,
);
$this->eventDispatcher->dispatch($event);
$this->request = $event->getRequest();
Expand Down Expand Up @@ -129,7 +129,7 @@ protected function callActionMethod(RequestInterface $request): ResponseInterfac
$this->setHeadersAndExit(
$response,
$this->feedFormats[$request->getFormat()],
$request->getFormat()
$request->getFormat(),
);
}

Expand All @@ -151,7 +151,7 @@ protected function callActionMethod(RequestInterface $request): ResponseInterfac
protected function setHeadersAndExit(
ResponseInterface $response,
string $contentType,
string $fileExtension
string $fileExtension,
): void {
if (200 !== $response->getStatusCode()) {
// Prevents html error pages to be returned with wrong Content-Type.
Expand All @@ -170,8 +170,8 @@ protected function setHeadersAndExit(
$response->getBody()->rewind();
$response = $response->withBody(
$this->streamFactory->createStream(
str_replace("\n", "\r\n", $response->getBody()->getContents())
)
str_replace("\n", "\r\n", $response->getBody()->getContents()),
),
);
}
// Any other actions (rendered before this) returning a status code >= 300 code would cause the status header
Expand Down Expand Up @@ -210,7 +210,7 @@ protected function eventExtendedAssignMultiple(array $variables, string $classNa
protected function eventExtendedRedirect(
string $className,
string $eventName,
array $variables = []
array $variables = [],
): ResponseInterface {
// set default variables for the redirect
if (empty($variables)) {
Expand Down Expand Up @@ -238,7 +238,7 @@ protected function eventExtendedRedirect(
$variables['extended']['arguments'],
$variables['extended']['pageUid'],
$variables['extended']['delay'],
$variables['extended']['statusCode']
$variables['extended']['statusCode'],
);
}

Expand Down Expand Up @@ -292,7 +292,7 @@ protected function checkStaticTemplateIsIncluded(): void
'Basic configuration settings are missing. It seems, that the Static Extension TypoScript
is not loaded to your TypoScript configuration. Please add the calendarize TS to your TS settings.',
'Configuration Error',
ContextualFeedbackSeverity::ERROR
ContextualFeedbackSeverity::ERROR,
);
}
}
Expand All @@ -318,7 +318,7 @@ protected function return404Page(): ResponseInterface
return GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
$this->request,
'The requested page does not exist',
['code' => PageAccessFailureReasons::PAGE_NOT_FOUND]
['code' => PageAccessFailureReasons::PAGE_NOT_FOUND],
);
}
}
4 changes: 2 additions & 2 deletions Classes/Controller/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public function initializeListAction(): void
->setTypeConverterOption(
DateTimeConverter::class,
DateTimeConverter::CONFIGURATION_DATE_FORMAT,
'Y-m-d'
'Y-m-d',
);
$optionsConfiguration->forProperty('endDate')
->setTypeConverterOption(
DateTimeConverter::class,
DateTimeConverter::CONFIGURATION_DATE_FORMAT,
'Y-m-d'
'Y-m-d',
);
}

Expand Down
32 changes: 16 additions & 16 deletions Classes/Controller/CalendarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ public function initializeAction(): void
->setTypeConverterOption(
DateTimeConverter::class,
DateTimeConverter::CONFIGURATION_DATE_FORMAT,
'Y-m-d'
'Y-m-d',
);
}
if (isset($this->arguments['endDate'])) {
$this->arguments['endDate']->getPropertyMappingConfiguration()
->setTypeConverterOption(
DateTimeConverter::class,
DateTimeConverter::CONFIGURATION_DATE_FORMAT,
'Y-m-d'
'Y-m-d',
);
}

Expand All @@ -68,7 +68,7 @@ public function initializeAction(): void
protected function modifyIndexRepository(): void
{
$this->indexRepository->setIndexTypes(
GeneralUtility::trimExplode(',', $this->settings['configuration'] ?? '', true)
GeneralUtility::trimExplode(',', $this->settings['configuration'] ?? '', true),
);
$additionalSlotArguments = [
'contentRecord' => $this->request->getAttribute('currentContentObject')->data,
Expand All @@ -80,7 +80,7 @@ protected function modifyIndexRepository(): void
if (isset($this->settings['sortBy'])) {
$this->indexRepository->setDefaultSortingDirection(
$this->settings['sorting'],
$this->settings['sortBy']
$this->settings['sortBy'],
);
} else {
$this->indexRepository->setDefaultSortingDirection($this->settings['sorting']);
Expand Down Expand Up @@ -125,7 +125,7 @@ public function latestAction(
array $customSearch = [],
int $year = 0,
int $month = 0,
int $week = 0
int $week = 0,
): ResponseInterface {
$this->checkStaticTemplateIsIncluded();
if (($index instanceof Index) && \in_array('detail', $this->getAllowedActions(), true)) {
Expand Down Expand Up @@ -166,7 +166,7 @@ public function resultAction(
array $customSearch = [],
int $year = 0,
int $month = 0,
int $week = 0
int $week = 0,
): ResponseInterface {
$this->checkStaticTemplateIsIncluded();
if (($index instanceof Index) && \in_array('detail', $this->getAllowedActions(), true)) {
Expand Down Expand Up @@ -208,7 +208,7 @@ public function listAction(
int $year = 0,
int $month = 0,
int $day = 0,
int $week = 0
int $week = 0,
): ResponseInterface {
$this->checkStaticTemplateIsIncluded();
if (($index instanceof Index) && \in_array('detail', $this->getAllowedActions(), true)) {
Expand Down Expand Up @@ -270,7 +270,7 @@ public function shortcutAction(): ResponseInterface
*/
public function pastAction(
int $limit = 100,
string $sort = 'ASC'
string $sort = 'ASC',
): ResponseInterface {
if ($this->request->hasArgument('format')) {
if ('html' != $this->request->getArgument('format')) {
Expand Down Expand Up @@ -497,7 +497,7 @@ public function dayAction(int $year = 0, int $month = 0, int $day = 0): Response
$indices = $this->indexRepository->findDay(
(int)$date->format('Y'),
(int)$date->format('n'),
(int)$date->format('j')
(int)$date->format('j'),
);

$this->eventExtendedAssignMultiple([
Expand Down Expand Up @@ -547,7 +547,7 @@ public function detailAction(?Index $index = null): ResponseInterface
['calendarize_detail', 'calendarize_index_' . $index->getUid(), 'calendarize_'
. lcfirst($uniqueRegisterKey)
. '_'
. $originalObject->getUid(), ]
. $originalObject->getUid(), ],
);

// Meta tags
Expand All @@ -571,7 +571,7 @@ public function detailAction(?Index $index = null): ResponseInterface
;
$processedImage = $imageService->applyProcessingInstructions(
$images[0]->getOriginalResource(),
$processingInstructions
$processingInstructions,
);
$imageUrl = $this->getBaseUri() . $imageService->getImageUri($processedImage);
$metaTagManagerRegistry->getManagerForProperty('og:image')->addProperty('og:image', $imageUrl);
Expand Down Expand Up @@ -604,7 +604,7 @@ public function detailAction(?Index $index = null): ResponseInterface
public function searchAction(
?\DateTime $startDate = null,
?\DateTime $endDate = null,
array $customSearch = []
array $customSearch = [],
): ResponseInterface {
$this->addCacheTags(['calendarize_search']);

Expand Down Expand Up @@ -676,7 +676,7 @@ protected function determineSearch(
int $year = 0,
int $month = 0,
int $day = 0,
int $week = 0
int $week = 0,
): array {
$searchMode = false;
[$startDate, $endDate] = $this->checkWrongDateOrder($startDate, $endDate);
Expand Down Expand Up @@ -725,7 +725,7 @@ protected function determineSearch(
(int)($this->settings['listStartTimeOffsetHours'] ?? 0),
$overrideStartDate,
$overrideEndDate,
(bool)($this->settings['ignoreStoragePid'] ?? false)
(bool)($this->settings['ignoreStoragePid'] ?? false),
);
}

Expand Down Expand Up @@ -784,7 +784,7 @@ protected function getPagination(QueryResultInterface $queryResult): array
'itemsPerPage' => $itemsPerPage,
'maximumNumberOfLinks' => $maximumNumberOfLinks,
'currentPage' => $currentPage,
]
],
);
$this->eventDispatcher->dispatch($event);
$paginator = $event->getPaginator();
Expand All @@ -802,7 +802,7 @@ protected function getPagination(QueryResultInterface $queryResult): array
protected function getAllowedActions(): array
{
$configuration = $this->configurationManager->getConfiguration(
ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK
ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK,
);
$allowedActions = [];
foreach ($configuration['controllerConfiguration'] as $controllerName => $controllerActions) {
Expand Down
12 changes: 6 additions & 6 deletions Classes/DataProcessing/DisableLanguageMenuProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function process(
ContentObjectRenderer $cObj,
array $contentObjectConfiguration,
array $processorConfiguration,
array $processedData
array $processedData,
): array {
if (!$processorConfiguration['menus']) {
return $processedData;
Expand Down Expand Up @@ -97,7 +97,7 @@ protected function getAvailableLanguages(int $indexId): array
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable(self::TABLE);
$queryBuilder->getRestrictions()->add(
GeneralUtility::makeInstance(WorkspaceRestriction::class)
GeneralUtility::makeInstance(WorkspaceRestriction::class),
);

$result = $queryBuilder
Expand All @@ -108,14 +108,14 @@ protected function getAvailableLanguages(int $indexId): array
// Current language of the record
$queryBuilder->expr()->eq(
'uid',
$queryBuilder->createNamedParameter($indexId, Connection::PARAM_INT)
$queryBuilder->createNamedParameter($indexId, Connection::PARAM_INT),
),
// Translated versions of the records (found by l10n_parent)
$queryBuilder->expr()->eq(
$transOrigPointerField,
$queryBuilder->createNamedParameter($uid, Connection::PARAM_INT)
)
)
$queryBuilder->createNamedParameter($uid, Connection::PARAM_INT),
),
),
)
->executeQuery();

Expand Down
4 changes: 1 addition & 3 deletions Classes/Domain/Model/AbstractModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@
/**
* Model Abstraction.
*/
class AbstractModel extends AbstractEntity
{
}
class AbstractModel extends AbstractEntity {}
4 changes: 2 additions & 2 deletions Classes/Domain/Model/Dto/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function getCategory(): int
{
@trigger_error(
'HDNET\Calendarize\Domain\Model\Dto\Search::getCategory',
\E_USER_DEPRECATED
\E_USER_DEPRECATED,
);

return $this->categories[0] ?? 0;
Expand All @@ -47,7 +47,7 @@ public function setCategory(int $category): void
{
@trigger_error(
'HDNET\Calendarize\Domain\Model\Dto\Search::setCategory',
\E_USER_DEPRECATED
\E_USER_DEPRECATED,
);
$this->categories = [$category];
}
Expand Down
Loading

0 comments on commit ac9e593

Please sign in to comment.