Skip to content

Commit aa7efbf

Browse files
committed
[TASK] Adjust method annotations and fix empty array key access
1 parent 1d67682 commit aa7efbf

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

Classes/Controller/AbstractController.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -377,11 +377,9 @@ protected function initializeDeleteAction()
377377
/**
378378
* Check if user is authenticated and params are valid
379379
*
380-
* @param User $user
381380
* @param int $uid Given fe_users uid
382-
* @param string $receivedToken Token
383381
*/
384-
protected function testSpoof($user, $uid, $receivedToken)
382+
protected function testSpoof(User $user, int $uid, string $receivedToken): ResponseInterface
385383
{
386384
$errorOnProfileUpdate = false;
387385
$knownToken = GeneralUtility::hmac($user->getUid(), (string)$user->getCrdate()->getTimestamp());
@@ -428,7 +426,7 @@ public function assignForAll()
428426
);
429427
}
430428

431-
public function initializeAction()
429+
public function initializeAction(): void
432430
{
433431
$this->user = UserUtility::getCurrentUser();
434432
$this->contentObject = $this->configurationManager->getContentObject();
@@ -444,23 +442,23 @@ public function initializeAction()
444442
$this->config = $this->config[BackendUtility::getPluginOrModuleString() . '.']['tx_femanager.']['settings.'] ?? [];
445443

446444
if (ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isBackend()) {
447-
$config = BackendUtility::loadTS($this->allConfig['settings']['configPID']);
445+
$config = BackendUtility::loadTS($this->allConfig['settings']['configPID'] ?? null);
448446
if (is_array($config['plugin.']['tx_femanager.']['settings.'] ?? null)) {
449447
$this->config = $config['plugin.']['tx_femanager.']['settings.'];
450448
$this->settings = $this->config;
451449
}
452450

453-
$this->moduleConfig = $config['module.']['tx_femanager.'] ?? '';
451+
$this->moduleConfig = $config['module.']['tx_femanager.'] ?? [];
454452

455453
// Retrieve page TSconfig of the current page
456454
$pageTsConfig = BackendUtilityCore::getPagesTSconfig(BackendUtility::getPageIdentifier());
457-
if (is_array($pageTsConfig['module.']['tx_femanager.'] ?? null)) {
455+
if (is_array($pageTsConfig['module.']['tx_femanager.'] ?? [])) {
458456
$this->moduleConfig = array_merge($this->moduleConfig, $pageTsConfig['module.']['tx_femanager.'] ?? []);
459457
}
460458

461459
// Retrieve user TSconfig of currently logged in user
462460
$userTsConfig = $GLOBALS['BE_USER']->getTSConfig();
463-
if (is_array($userTsConfig['tx_femanager.'] ?? null)) {
461+
if (is_array($userTsConfig['tx_femanager.'] ?? [])) {
464462
$this->moduleConfig = array_merge_recursive($this->moduleConfig, $userTsConfig['tx_femanager.'] ?? []);
465463
}
466464
}

Classes/Controller/UserBackendController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ public function confirmationAction(array $filter = []): ResponseInterface
6060
return $this->htmlResponse();
6161
}
6262

63-
public function userLogoutAction(User $user)
63+
public function userLogoutAction(User $user): ResponseInterface
6464
{
6565
UserUtility::removeFrontendSessionToUser($user);
6666
$this->addFlashMessage('User successfully logged out');
6767
$this->redirect('list');
6868
}
6969

70-
public function confirmUserAction(int $userIdentifier)
70+
public function confirmUserAction(int $userIdentifier): ResponseInterface
7171
{
7272
$this->configPID = $this->getConfigPID();
7373

0 commit comments

Comments
 (0)