aboutsummaryrefslogtreecommitdiffstats
path: root/apps/sharebymail/lib
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-10-18 12:04:22 +0200
committerprovokateurin <kate@provokateurin.de>2024-10-21 12:37:59 +0200
commit381077028adf388a7081cf42026570c6be47b198 (patch)
treec0f8e9b6caea80d6b55d6fdcc9188ba57197fa0f /apps/sharebymail/lib
parent4d8d11d2f79da348644e0902e78a2f000498cd52 (diff)
downloadnextcloud-server-381077028adf388a7081cf42026570c6be47b198.tar.gz
nextcloud-server-381077028adf388a7081cf42026570c6be47b198.zip
refactor(apps): Use constructor property promotion when possible
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps/sharebymail/lib')
-rw-r--r--apps/sharebymail/lib/Activity.php27
-rw-r--r--apps/sharebymail/lib/Capabilities.php20
-rw-r--r--apps/sharebymail/lib/Settings/Admin.php13
-rw-r--r--apps/sharebymail/lib/Settings/SettingsManager.php8
4 files changed, 20 insertions, 48 deletions
diff --git a/apps/sharebymail/lib/Activity.php b/apps/sharebymail/lib/Activity.php
index be9deeb7290..ae3407c1e2b 100644
--- a/apps/sharebymail/lib/Activity.php
+++ b/apps/sharebymail/lib/Activity.php
@@ -16,23 +16,9 @@ use OCP\IUserManager;
use OCP\L10N\IFactory;
class Activity implements IProvider {
- /** @var IFactory */
- protected $languageFactory;
-
/** @var IL10N */
protected $l;
- /** @var IURLGenerator */
- protected $url;
-
- /** @var IManager */
- protected $activityManager;
-
- /** @var IUserManager */
- protected $userManager;
- /** @var IContactsManager */
- protected $contactsManager;
-
/** @var array */
protected $contactNames = [];
@@ -50,12 +36,13 @@ class Activity implements IProvider {
* @param IUserManager $userManager
* @param IContactsManager $contactsManager
*/
- public function __construct(IFactory $languageFactory, IURLGenerator $url, IManager $activityManager, IUserManager $userManager, IContactsManager $contactsManager) {
- $this->languageFactory = $languageFactory;
- $this->url = $url;
- $this->activityManager = $activityManager;
- $this->userManager = $userManager;
- $this->contactsManager = $contactsManager;
+ public function __construct(
+ protected IFactory $languageFactory,
+ protected IURLGenerator $url,
+ protected IManager $activityManager,
+ protected IUserManager $userManager,
+ protected IContactsManager $contactsManager,
+ ) {
}
/**
diff --git a/apps/sharebymail/lib/Capabilities.php b/apps/sharebymail/lib/Capabilities.php
index ff6f634747b..5b489b7d790 100644
--- a/apps/sharebymail/lib/Capabilities.php
+++ b/apps/sharebymail/lib/Capabilities.php
@@ -15,21 +15,11 @@ use OCP\Share\IManager;
class Capabilities implements ICapability {
- /** @var IManager */
- private $manager;
-
- /** @var SettingsManager */
- private $settingsManager;
-
- /** @var IAppManager */
- private $appManager;
-
- public function __construct(IManager $manager,
- SettingsManager $settingsManager,
- IAppManager $appManager) {
- $this->manager = $manager;
- $this->settingsManager = $settingsManager;
- $this->appManager = $appManager;
+ public function __construct(
+ private IManager $manager,
+ private SettingsManager $settingsManager,
+ private IAppManager $appManager,
+ ) {
}
/**
diff --git a/apps/sharebymail/lib/Settings/Admin.php b/apps/sharebymail/lib/Settings/Admin.php
index 5fdf633bea1..2bd58f7307f 100644
--- a/apps/sharebymail/lib/Settings/Admin.php
+++ b/apps/sharebymail/lib/Settings/Admin.php
@@ -11,14 +11,11 @@ use OCP\IL10N;
use OCP\Settings\IDelegatedSettings;
class Admin implements IDelegatedSettings {
- private SettingsManager $settingsManager;
- private IL10N $l;
- private IInitialState $initialState;
-
- public function __construct(SettingsManager $settingsManager, IL10N $l, IInitialState $initialState) {
- $this->settingsManager = $settingsManager;
- $this->l = $l;
- $this->initialState = $initialState;
+ public function __construct(
+ private SettingsManager $settingsManager,
+ private IL10N $l,
+ private IInitialState $initialState,
+ ) {
}
/**
diff --git a/apps/sharebymail/lib/Settings/SettingsManager.php b/apps/sharebymail/lib/Settings/SettingsManager.php
index c58f4950e91..d487bd2ac43 100644
--- a/apps/sharebymail/lib/Settings/SettingsManager.php
+++ b/apps/sharebymail/lib/Settings/SettingsManager.php
@@ -12,15 +12,13 @@ use OCP\IConfig;
class SettingsManager {
- /** @var IConfig */
- private $config;
-
private $sendPasswordByMailDefault = 'yes';
private $replyToInitiatorDefault = 'yes';
- public function __construct(IConfig $config) {
- $this->config = $config;
+ public function __construct(
+ private IConfig $config,
+ ) {
}
/**