summaryrefslogtreecommitdiffstats
path: root/lib/Notification
diff options
context:
space:
mode:
authorHamid Dehnavi <hamid.dev.pro@gmail.com>2023-07-10 23:12:51 +0330
committerHamid Dehnavi <hamid.dev.pro@gmail.com>2023-07-10 23:12:51 +0330
commitda1ff81556c6f0983d201efbe5343ed9b4ba8b7b (patch)
treeb80d30bde1c95f94740bf5f41d303e101e803004 /lib/Notification
parent4205596c7b61caa68170dcae0d920d1af453a316 (diff)
Use PHP8's constructor property promotion
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
Diffstat (limited to 'lib/Notification')
-rw-r--r--lib/Notification/Listener.php28
-rw-r--r--lib/Notification/Notifier.php72
2 files changed, 25 insertions, 75 deletions
diff --git a/lib/Notification/Listener.php b/lib/Notification/Listener.php
index c85ca38b5..12cee6847 100644
--- a/lib/Notification/Listener.php
+++ b/lib/Notification/Listener.php
@@ -47,32 +47,18 @@ use Psr\Log\LoggerInterface;
* @template-implements IEventListener<Event>
*/
class Listener implements IEventListener {
- protected IDBConnection $connection;
- protected IManager $notificationManager;
- protected ParticipantService $participantsService;
- protected IEventDispatcher $dispatcher;
- protected IUserSession $userSession;
- protected ITimeFactory $timeFactory;
- protected LoggerInterface $logger;
protected bool $shouldSendCallNotification = false;
public function __construct(
- IDBConnection $connection,
- IManager $notificationManager,
- ParticipantService $participantsService,
- IEventDispatcher $dispatcher,
- IUserSession $userSession,
- ITimeFactory $timeFactory,
- LoggerInterface $logger,
+ protected IDBConnection $connection,
+ protected IManager $notificationManager,
+ protected ParticipantService $participantsService,
+ protected IEventDispatcher $dispatcher,
+ protected IUserSession $userSession,
+ protected ITimeFactory $timeFactory,
+ protected LoggerInterface $logger,
) {
- $this->connection = $connection;
- $this->notificationManager = $notificationManager;
- $this->participantsService = $participantsService;
- $this->dispatcher = $dispatcher;
- $this->userSession = $userSession;
- $this->timeFactory = $timeFactory;
- $this->logger = $logger;
}
public static function register(IEventDispatcher $dispatcher): void {
diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php
index f2b9fe5ea..f799040c9 100644
--- a/lib/Notification/Notifier.php
+++ b/lib/Notification/Notifier.php
@@ -61,24 +61,6 @@ use OCP\Share\IManager as IShareManager;
use OCP\Share\IShare;
class Notifier implements INotifier {
- protected IFactory $lFactory;
- protected IURLGenerator $url;
- protected Config $config;
- protected IUserManager $userManager;
- protected IGroupManager $groupManager;
- protected GuestManager $guestManager;
- private IShareManager $shareManager;
- protected Manager $manager;
- protected ParticipantService $participantService;
- protected AvatarService $avatarService;
- protected INotificationManager $notificationManager;
- protected ICommentsManager $commentManager;
- protected MessageParser $messageParser;
- protected IURLGenerator $urlGenerator;
- protected IRootFolder $rootFolder;
- protected ITimeFactory $timeFactory;
- protected Definitions $definitions;
- protected AddressHandler $addressHandler;
/** @var Room[] */
protected array $rooms = [];
@@ -86,43 +68,25 @@ class Notifier implements INotifier {
protected array $participants = [];
public function __construct(
- IFactory $lFactory,
- IURLGenerator $url,
- Config $config,
- IUserManager $userManager,
- IGroupManager $groupManager,
- GuestManager $guestManager,
- IShareManager $shareManager,
- Manager $manager,
- ParticipantService $participantService,
- AvatarService $avatarService,
- INotificationManager $notificationManager,
- CommentsManager $commentManager,
- MessageParser $messageParser,
- IURLGenerator $urlGenerator,
- IRootFolder $rootFolder,
- ITimeFactory $timeFactory,
- Definitions $definitions,
- AddressHandler $addressHandler,
+ protected IFactory $lFactory,
+ protected IURLGenerator $url,
+ protected Config $config,
+ protected IUserManager $userManager,
+ protected IGroupManager $groupManager,
+ protected GuestManager $guestManager,
+ private IShareManager $shareManager,
+ protected Manager $manager,
+ protected ParticipantService $participantService,
+ protected AvatarService $avatarService,
+ protected INotificationManager $notificationManager,
+ protected CommentsManager $commentManager,
+ protected MessageParser $messageParser,
+ protected IURLGenerator $urlGenerator,
+ protected IRootFolder $rootFolder,
+ protected ITimeFactory $timeFactory,
+ protected Definitions $definitions,
+ protected AddressHandler $addressHandler,
) {
- $this->lFactory = $lFactory;
- $this->url = $url;
- $this->config = $config;
- $this->userManager = $userManager;
- $this->groupManager = $groupManager;
- $this->guestManager = $guestManager;
- $this->shareManager = $shareManager;
- $this->manager = $manager;
- $this->participantService = $participantService;
- $this->avatarService = $avatarService;
- $this->notificationManager = $notificationManager;
- $this->commentManager = $commentManager;
- $this->messageParser = $messageParser;
- $this->urlGenerator = $urlGenerator;
- $this->rootFolder = $rootFolder;
- $this->timeFactory = $timeFactory;
- $this->definitions = $definitions;
- $this->addressHandler = $addressHandler;
}
/**