aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Notification/Manager.php
diff options
context:
space:
mode:
authorHamid Dehnavi <hamid.dev.pro@gmail.com>2023-07-05 21:25:05 +0330
committerCôme Chilliet <91878298+come-nc@users.noreply.github.com>2024-01-02 16:54:54 +0100
commit0ac1480be26105081b71241fa91c1f56a306db9d (patch)
tree0bdb68550b131498155b0e80e4c58f8f341164cd /lib/private/Notification/Manager.php
parent7ac903106fbb05841a2f20b526eb46dd6c0b68e8 (diff)
downloadnextcloud-server-0ac1480be26105081b71241fa91c1f56a306db9d.tar.gz
nextcloud-server-0ac1480be26105081b71241fa91c1f56a306db9d.zip
refactor lib/private/Notification
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
Diffstat (limited to 'lib/private/Notification/Manager.php')
-rw-r--r--lib/private/Notification/Manager.php45
1 files changed, 16 insertions, 29 deletions
diff --git a/lib/private/Notification/Manager.php b/lib/private/Notification/Manager.php
index e81b6c4fa35..c712d2754e2 100644
--- a/lib/private/Notification/Manager.php
+++ b/lib/private/Notification/Manager.php
@@ -43,48 +43,35 @@ use Psr\Container\ContainerExceptionInterface;
use Psr\Log\LoggerInterface;
class Manager implements IManager {
- /** @var IValidator */
- protected $validator;
- /** @var IUserManager */
- private $userManager;
/** @var ICache */
- protected $cache;
- /** @var IRegistry */
- protected $subscription;
- /** @var LoggerInterface */
- protected $logger;
- /** @var Coordinator */
- private $coordinator;
+ protected ICache $cache;
/** @var IApp[] */
- protected $apps;
+ protected array $apps;
/** @var string[] */
- protected $appClasses;
+ protected array $appClasses;
/** @var INotifier[] */
- protected $notifiers;
+ protected array $notifiers;
/** @var string[] */
- protected $notifierClasses;
+ protected array $notifierClasses;
/** @var bool */
- protected $preparingPushNotification;
+ protected bool $preparingPushNotification;
/** @var bool */
- protected $deferPushing;
+ protected bool $deferPushing;
/** @var bool */
- private $parsedRegistrationContext;
+ private bool $parsedRegistrationContext;
- public function __construct(IValidator $validator,
- IUserManager $userManager,
+ public function __construct(
+ protected IValidator $validator,
+ private IUserManager $userManager,
ICacheFactory $cacheFactory,
- IRegistry $subscription,
- LoggerInterface $logger,
- Coordinator $coordinator) {
- $this->validator = $validator;
- $this->userManager = $userManager;
+ protected IRegistry $subscription,
+ protected LoggerInterface $logger,
+ private Coordinator $coordinator,
+ ) {
$this->cache = $cacheFactory->createDistributed('notifications');
- $this->subscription = $subscription;
- $this->logger = $logger;
- $this->coordinator = $coordinator;
$this->apps = [];
$this->notifiers = [];
@@ -111,7 +98,7 @@ class Manager implements IManager {
* @deprecated 17.0.0 use registerNotifierService instead.
* @since 8.2.0 - Parameter $info was added in 9.0.0
*/
- public function registerNotifier(\Closure $service, \Closure $info) {
+ public function registerNotifier(\Closure $service, \Closure $info): void {
$infoData = $info();
$exception = new \InvalidArgumentException(
'Notifier ' . $infoData['name'] . ' (id: ' . $infoData['id'] . ') is not considered because it is using the old way to register.'