diff --git a/typo3/sysext/felogin/Classes/Configuration/RecoveryConfiguration.php b/typo3/sysext/felogin/Classes/Configuration/RecoveryConfiguration.php index c71a3dbd056229f0309d8785cb6300a0c0ddd0cc..f01dcf8490399c4d08824167dcf2595889edf252 100644 --- a/typo3/sysext/felogin/Classes/Configuration/RecoveryConfiguration.php +++ b/typo3/sysext/felogin/Classes/Configuration/RecoveryConfiguration.php @@ -23,7 +23,6 @@ use Symfony\Component\Mime\Address; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Crypto\Random; use TYPO3\CMS\Extbase\Configuration\ConfigurationManager; -use TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException; use TYPO3\CMS\Extbase\Security\Cryptography\HashService; use TYPO3\CMS\Fluid\View\TemplatePaths; @@ -34,11 +33,6 @@ class RecoveryConfiguration implements LoggerAwareInterface { use LoggerAwareTrait; - /** - * @var Context - */ - protected $context; - /** * @var string */ @@ -69,22 +63,12 @@ class RecoveryConfiguration implements LoggerAwareInterface */ protected $timestamp; - /** - * @param Context $context - * @param ConfigurationManager $configurationManager - * @param Random $random - * @param HashService $hashService - * - * @throws IncompleteConfigurationException - * @throws InvalidConfigurationTypeException - */ public function __construct( - Context $context, + protected Context $context, ConfigurationManager $configurationManager, Random $random, HashService $hashService ) { - $this->context = $context; $this->settings = $configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS); $this->forgotHash = $this->getLifeTimeTimestamp() . '|' . $this->generateHash($random, $hashService); $this->resolveFromTypoScript(); diff --git a/typo3/sysext/felogin/Classes/Configuration/RedirectConfiguration.php b/typo3/sysext/felogin/Classes/Configuration/RedirectConfiguration.php index 71f51c3c810063d1f1c69cb3cecd563cc04489ee..10a46863e272ca5366cb3e2e879f609cf372803b 100644 --- a/typo3/sysext/felogin/Classes/Configuration/RedirectConfiguration.php +++ b/typo3/sysext/felogin/Classes/Configuration/RedirectConfiguration.php @@ -31,39 +31,15 @@ class RedirectConfiguration */ protected $modes; - /** - * @var string - */ - protected $firstMode; - - /** - * @var int - */ - protected $pageOnLogin; - - /** - * @var string - */ - protected $domains; - - /** - * @var int - */ - protected $pageOnLoginError; - - /** - * @var int - */ - protected $pageOnLogout; - - public function __construct($mode, string $firstMode, int $pageOnLogin, string $domains, int $pageOnLoginError, int $pageOnLogout) - { + public function __construct( + array|string|null $mode, + protected string $firstMode, + protected int $pageOnLogin, + protected string $domains, + protected int $pageOnLoginError, + protected int $pageOnLogout + ) { $this->modes = is_array($mode) ? $mode : GeneralUtility::trimExplode(',', $mode ?? '', true); - $this->firstMode = $firstMode; - $this->pageOnLogin = $pageOnLogin; - $this->domains = $domains; - $this->pageOnLoginError = $pageOnLoginError; - $this->pageOnLogout = $pageOnLogout; } public function getModes(): array diff --git a/typo3/sysext/felogin/Classes/Controller/LoginController.php b/typo3/sysext/felogin/Classes/Controller/LoginController.php index a2b3e8af94ea74f05507397c6fbf1da3372ce1c1..9b2627e28afc61705e942638ce74f91fcc8315f1 100644 --- a/typo3/sysext/felogin/Classes/Controller/LoginController.php +++ b/typo3/sysext/felogin/Classes/Controller/LoginController.php @@ -17,7 +17,6 @@ declare(strict_types=1); namespace TYPO3\CMS\FrontendLogin\Controller; -use Psr\EventDispatcher\EventDispatcherInterface; use Psr\Http\Message\ResponseInterface; use TYPO3\CMS\Core\Authentication\LoginType; use TYPO3\CMS\Core\Context\Context; @@ -54,11 +53,6 @@ class LoginController extends AbstractLoginFormController */ public const MESSAGEKEY_LOGOUT = 'logout'; - /** - * @var RedirectHandler - */ - protected $redirectHandler; - /** * @var string */ @@ -69,26 +63,11 @@ class LoginController extends AbstractLoginFormController */ protected $redirectUrl = ''; - /** - * @var ServerRequestHandler - */ - protected $requestHandler; - - /** - * @var UserService - */ - protected $userService; - /** * @var RedirectConfiguration */ protected $configuration; - /** - * @var EventDispatcherInterface - */ - protected $eventDispatcher; - /** * @var UserAspect */ @@ -100,15 +79,10 @@ class LoginController extends AbstractLoginFormController protected $showCookieWarning = false; public function __construct( - RedirectHandler $redirectHandler, - ServerRequestHandler $requestHandler, - UserService $userService, - EventDispatcherInterface $eventDispatcher + protected RedirectHandler $redirectHandler, + protected ServerRequestHandler $requestHandler, + protected UserService $userService ) { - $this->redirectHandler = $redirectHandler; - $this->requestHandler = $requestHandler; - $this->userService = $userService; - $this->eventDispatcher = $eventDispatcher; $this->userAspect = GeneralUtility::makeInstance(Context::class)->getAspect('frontend.user'); } diff --git a/typo3/sysext/felogin/Classes/Controller/PasswordRecoveryController.php b/typo3/sysext/felogin/Classes/Controller/PasswordRecoveryController.php index a12b763f5b6a781248e6f24d816afbdb49d084ba..68bc66195a5a088326abbfbdfb7f4f4c3135a32b 100644 --- a/typo3/sysext/felogin/Classes/Controller/PasswordRecoveryController.php +++ b/typo3/sysext/felogin/Classes/Controller/PasswordRecoveryController.php @@ -17,7 +17,6 @@ declare(strict_types=1); namespace TYPO3\CMS\FrontendLogin\Controller; -use Psr\EventDispatcher\EventDispatcherInterface; use Psr\Http\Message\ResponseInterface; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Context\Exception\AspectNotFoundException; @@ -40,29 +39,10 @@ use TYPO3\CMS\FrontendLogin\Service\ValidatorResolverService; */ class PasswordRecoveryController extends AbstractLoginFormController { - /** - * @var RecoveryServiceInterface - */ - protected $recoveryService; - - /** - * @var FrontendUserRepository - */ - protected $userRepository; - - /** - * @var EventDispatcherInterface - */ - protected $eventDispatcher; - public function __construct( - EventDispatcherInterface $eventDispatcher, - RecoveryServiceInterface $recoveryService, - FrontendUserRepository $userRepository + protected RecoveryServiceInterface $recoveryService, + protected FrontendUserRepository $userRepository ) { - $this->eventDispatcher = $eventDispatcher; - $this->recoveryService = $recoveryService; - $this->userRepository = $userRepository; } /** diff --git a/typo3/sysext/felogin/Classes/Domain/Repository/FrontendUserRepository.php b/typo3/sysext/felogin/Classes/Domain/Repository/FrontendUserRepository.php index c543cb3bdf922581b5b13099c2c52a8e3e37e744..4048f921a5051ddc60d027373da2e772043079cd 100644 --- a/typo3/sysext/felogin/Classes/Domain/Repository/FrontendUserRepository.php +++ b/typo3/sysext/felogin/Classes/Domain/Repository/FrontendUserRepository.php @@ -33,23 +33,9 @@ class FrontendUserRepository */ protected $connection; - /** - * @var Context - */ - protected $context; - - /** - * @var UserService - */ - protected $userService; - - public function __construct( - UserService $userService, - Context $context - ) { - $this->userService = $userService; + public function __construct(protected UserService $userService, protected Context $context) + { $this->connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($this->getTable()); - $this->context = $context; } public function getTable(): string diff --git a/typo3/sysext/felogin/Classes/Redirect/RedirectHandler.php b/typo3/sysext/felogin/Classes/Redirect/RedirectHandler.php index d16f7488c1d75051d60a59725c5030a613bfbc53..3b324109cc39f0b2be4dbdea9e4e825222e2e8c4 100644 --- a/typo3/sysext/felogin/Classes/Redirect/RedirectHandler.php +++ b/typo3/sysext/felogin/Classes/Redirect/RedirectHandler.php @@ -33,23 +33,11 @@ class RedirectHandler */ protected $userIsLoggedIn = false; - /** - * @var ServerRequestHandler - */ - protected $requestHandler; - - /** - * @var RedirectModeHandler - */ - protected $redirectModeHandler; - public function __construct( - ServerRequestHandler $requestHandler, - RedirectModeHandler $redirectModeHandler, + protected ServerRequestHandler $requestHandler, + protected RedirectModeHandler $redirectModeHandler, Context $context ) { - $this->requestHandler = $requestHandler; - $this->redirectModeHandler = $redirectModeHandler; $this->userIsLoggedIn = (bool)$context->getPropertyFromAspect('frontend.user', 'isLoggedIn'); } diff --git a/typo3/sysext/felogin/Classes/Redirect/RedirectModeHandler.php b/typo3/sysext/felogin/Classes/Redirect/RedirectModeHandler.php index 4ae81528f246706726a7f3da2a8ff6be6e7875c1..f25aa394a70fbe4a8d914af40f6a304ce514f19a 100644 --- a/typo3/sysext/felogin/Classes/Redirect/RedirectModeHandler.php +++ b/typo3/sysext/felogin/Classes/Redirect/RedirectModeHandler.php @@ -37,47 +37,17 @@ class RedirectModeHandler */ protected $redirectUrlValidator; - /** - * @var UriBuilder - */ - protected $uriBuilder; - - /** - * @var ServerRequestHandler - */ - protected $serverRequestHandler; - - /** - * @var UserService - */ - private $userService; - - /** - * @var FrontendUserRepository - */ - private $frontendUserRepository; - - /** - * @var FrontendUserGroupRepository - */ - private $frontendUserGroupRepository; - public function __construct( - UriBuilder $uriBuilder, - ServerRequestHandler $serverRequestHandler, - UserService $userService, - FrontendUserRepository $frontendUserRepository, - FrontendUserGroupRepository $frontendUserGroupRepository + protected UriBuilder $uriBuilder, + protected ServerRequestHandler $serverRequestHandler, + private UserService $userService, + private FrontendUserRepository $frontendUserRepository, + private FrontendUserGroupRepository $frontendUserGroupRepository ) { - $this->uriBuilder = $uriBuilder; $this->redirectUrlValidator = GeneralUtility::makeInstance( RedirectUrlValidator::class, GeneralUtility::makeInstance(SiteFinder::class) ); - $this->serverRequestHandler = $serverRequestHandler; - $this->userService = $userService; - $this->frontendUserRepository = $frontendUserRepository; - $this->frontendUserGroupRepository = $frontendUserGroupRepository; } /** diff --git a/typo3/sysext/felogin/Classes/Service/RecoveryService.php b/typo3/sysext/felogin/Classes/Service/RecoveryService.php index e26877fd74097a11bc88bbeda79725d4cf914918..348088d4c549db699c95bd18d78f0b3dc58eceef 100644 --- a/typo3/sysext/felogin/Classes/Service/RecoveryService.php +++ b/typo3/sysext/felogin/Classes/Service/RecoveryService.php @@ -26,7 +26,6 @@ use TYPO3\CMS\Core\Mail\FluidEmail; use TYPO3\CMS\Core\Mail\Mailer; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Configuration\ConfigurationManager; -use TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException; use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder; use TYPO3\CMS\Extbase\Utility\LocalizationUtility; use TYPO3\CMS\FrontendLogin\Configuration\IncompleteConfigurationException; @@ -39,60 +38,20 @@ use TYPO3\CMS\FrontendLogin\Event\SendRecoveryEmailEvent; */ class RecoveryService implements RecoveryServiceInterface { - /** - * @var RecoveryConfiguration - */ - protected $recoveryConfiguration; - - /** - * @var EventDispatcherInterface - */ - protected $eventDispatcher; - - /** - * @var Mailer - */ - protected $mailer; - /** * @var array */ protected $settings; - /** - * @var UriBuilder - */ - protected $uriBuilder; - - /** - * @var FrontendUserRepository - */ - protected $userRepository; - - /** - * @param Mailer $mailer - * @param EventDispatcherInterface $eventDispatcher - * @param ConfigurationManager $configurationManager - * @param RecoveryConfiguration $recoveryConfiguration - * @param UriBuilder $uriBuilder - * @param FrontendUserRepository $userRepository - * - * @throws InvalidConfigurationTypeException - */ public function __construct( - Mailer $mailer, - EventDispatcherInterface $eventDispatcher, + protected Mailer $mailer, + protected EventDispatcherInterface $eventDispatcher, ConfigurationManager $configurationManager, - RecoveryConfiguration $recoveryConfiguration, - UriBuilder $uriBuilder, - FrontendUserRepository $userRepository + protected RecoveryConfiguration $recoveryConfiguration, + protected UriBuilder $uriBuilder, + protected FrontendUserRepository $userRepository ) { - $this->mailer = $mailer; - $this->eventDispatcher = $eventDispatcher; $this->settings = $configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS); - $this->recoveryConfiguration = $recoveryConfiguration; - $this->uriBuilder = $uriBuilder; - $this->userRepository = $userRepository; } /**