diff options
author | Faraz Samapoor <f.samapoor@gmail.com> | 2023-07-03 11:07:33 +0330 |
---|---|---|
committer | Faraz Samapoor <f.samapoor@gmail.com> | 2023-10-03 09:17:10 +0330 |
commit | a304ba5b5a0f05a7ba59c047bc8f44272ba1613e (patch) | |
tree | bb19af74c384c38aa29d770caa8cb62d9e5eb14a /lib/private/Collaboration/Reference/File/FileReferenceProvider.php | |
parent | 4d227c195f1dee04dc3fc426484ee07314da4385 (diff) | |
download | nextcloud-server-a304ba5b5a0f05a7ba59c047bc8f44272ba1613e.tar.gz nextcloud-server-a304ba5b5a0f05a7ba59c047bc8f44272ba1613e.zip |
Refactors lib/private/Collaboration.
Mainly using PHP8's constructor property promotion.
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
Diffstat (limited to 'lib/private/Collaboration/Reference/File/FileReferenceProvider.php')
-rw-r--r-- | lib/private/Collaboration/Reference/File/FileReferenceProvider.php | 20 |
1 files changed, 6 insertions, 14 deletions
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'); } |