From a304ba5b5a0f05a7ba59c047bc8f44272ba1613e Mon Sep 17 00:00:00 2001 From: Faraz Samapoor Date: Mon, 3 Jul 2023 11:07:33 +0330 Subject: Refactors lib/private/Collaboration. Mainly using PHP8's constructor property promotion. Signed-off-by: Faraz Samapoor --- .../Reference/File/FileReferenceProvider.php | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'lib/private/Collaboration/Reference/File/FileReferenceProvider.php') diff --git a/lib/private/Collaboration/Reference/File/FileReferenceProvider.php b/lib/private/Collaboration/Reference/File/FileReferenceProvider.php index d423a830495..5f384213976 100644 --- a/lib/private/Collaboration/Reference/File/FileReferenceProvider.php +++ b/lib/private/Collaboration/Reference/File/FileReferenceProvider.php @@ -41,26 +41,18 @@ use OCP\IUserSession; use OCP\L10N\IFactory; class FileReferenceProvider extends ADiscoverableReferenceProvider { - private IURLGenerator $urlGenerator; - private IRootFolder $rootFolder; private ?string $userId; - private IPreview $previewManager; - private IMimeTypeDetector $mimeTypeDetector; private IL10N $l10n; public function __construct( - IURLGenerator $urlGenerator, - IRootFolder $rootFolder, + private IURLGenerator $urlGenerator, + private IRootFolder $rootFolder, IUserSession $userSession, - IMimeTypeDetector $mimeTypeDetector, - IPreview $previewManager, - IFactory $l10n + private IMimeTypeDetector $mimeTypeDetector, + private IPreview $previewManager, + IFactory $l10n, ) { - $this->urlGenerator = $urlGenerator; - $this->rootFolder = $rootFolder; - $this->userId = $userSession->getUser() ? $userSession->getUser()->getUID() : null; - $this->previewManager = $previewManager; - $this->mimeTypeDetector = $mimeTypeDetector; + $this->userId = $userSession->getUser()?->getUID(); $this->l10n = $l10n->get('files'); } -- cgit v1.2.3