aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorfenn-cs <fenn25.fn@gmail.com>2024-04-30 12:19:22 +0100
committerfenn-cs <fenn25.fn@gmail.com>2024-05-23 14:11:33 +0100
commitf5a433f946e14eece904ea935cdc7ce29af0b9b7 (patch)
tree24d04bc852fce673200f1612fc1de89274b9a6ce /lib
parent59a5b4e0bddbc29d4e16a930972be34873a73e0c (diff)
downloadnextcloud-server-f5a433f946e14eece904ea935cdc7ce29af0b9b7.tar.gz
nextcloud-server-f5a433f946e14eece904ea935cdc7ce29af0b9b7.zip
refactor(shareManager): Use constructor property promotion
Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Share20/Manager.php98
1 files changed, 23 insertions, 75 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index 4b44edd8b01..11e246e6d21 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -84,86 +84,34 @@ use Psr\Log\LoggerInterface;
* This class is the communication hub for all sharing related operations.
*/
class Manager implements IManager {
- /** @var IProviderFactory */
- private $factory;
- private LoggerInterface $logger;
- /** @var IConfig */
- private $config;
- /** @var ISecureRandom */
- private $secureRandom;
- /** @var IHasher */
- private $hasher;
- /** @var IMountManager */
- private $mountManager;
- /** @var IGroupManager */
- private $groupManager;
- /** @var IL10N */
- private $l;
- /** @var IFactory */
- private $l10nFactory;
- /** @var IUserManager */
- private $userManager;
- /** @var IRootFolder */
- private $rootFolder;
- /** @var LegacyHooks */
- private $legacyHooks;
- /** @var IMailer */
- private $mailer;
- /** @var IURLGenerator */
- private $urlGenerator;
- /** @var \OC_Defaults */
- private $defaults;
- /** @var IEventDispatcher */
- private $dispatcher;
- /** @var IUserSession */
- private $userSession;
- /** @var KnownUserService */
- private $knownUserService;
- private ShareDisableChecker $shareDisableChecker;
- private IDateTimeZone $dateTimeZone;
+
+ private IL10N|null $l;
+ private LegacyHooks $legacyHooks;
public function __construct(
- LoggerInterface $logger,
- IConfig $config,
- ISecureRandom $secureRandom,
- IHasher $hasher,
- IMountManager $mountManager,
- IGroupManager $groupManager,
- IFactory $l10nFactory,
- IProviderFactory $factory,
- IUserManager $userManager,
- IRootFolder $rootFolder,
- IMailer $mailer,
- IURLGenerator $urlGenerator,
- \OC_Defaults $defaults,
- IEventDispatcher $dispatcher,
- IUserSession $userSession,
- KnownUserService $knownUserService,
- ShareDisableChecker $shareDisableChecker,
- IDateTimeZone $dateTimeZone,
+ private LoggerInterface $logger,
+ private IConfig $config,
+ private ISecureRandom $secureRandom,
+ private IHasher $hasher,
+ private IMountManager $mountManager,
+ private IGroupManager $groupManager,
+ private IFactory $l10nFactory,
+ private IProviderFactory $factory,
+ private IUserManager $userManager,
+ private IRootFolder $rootFolder,
+ private IMailer $mailer,
+ private IURLGenerator $urlGenerator,
+ private \OC_Defaults $defaults,
+ private IEventDispatcher $dispatcher,
+ private IUserSession $userSession,
+ private KnownUserService $knownUserService,
+ private ShareDisableChecker $shareDisableChecker,
+ private IDateTimeZone $dateTimeZone
) {
- $this->logger = $logger;
- $this->config = $config;
- $this->secureRandom = $secureRandom;
- $this->hasher = $hasher;
- $this->mountManager = $mountManager;
- $this->groupManager = $groupManager;
- $this->l = $l10nFactory->get('lib');
- $this->l10nFactory = $l10nFactory;
- $this->factory = $factory;
- $this->userManager = $userManager;
- $this->rootFolder = $rootFolder;
+ $this->l = $this->l10nFactory->get('lib');
// The constructor of LegacyHooks registers the listeners of share events
// do not remove if those are not properly migrated
- $this->legacyHooks = new LegacyHooks($dispatcher);
- $this->mailer = $mailer;
- $this->urlGenerator = $urlGenerator;
- $this->defaults = $defaults;
- $this->dispatcher = $dispatcher;
- $this->userSession = $userSession;
- $this->knownUserService = $knownUserService;
- $this->shareDisableChecker = $shareDisableChecker;
- $this->dateTimeZone = $dateTimeZone;
+ $this->legacyHooks = new LegacyHooks($this->dispatcher);
}
/**