Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: Use compact constructors
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Aug 27, 2024
commit c766a2ed95cf50105102db9e522d36e3bc0c82fb
18 changes: 5 additions & 13 deletions lib/EventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,11 @@
* @template-implements IEventListener<Event>
*/
class EventListener implements IEventListener {
/** @var INotificationManager */
protected $notificationManager;

/** @var IGroupManager */
protected $groupManager;

/** @var IUserSession */
protected $userSession;

public function __construct(INotificationManager $notificationManager, IGroupManager $groupManager, IUserSession $userSession) {
$this->notificationManager = $notificationManager;
$this->groupManager = $groupManager;
$this->userSession = $userSession;
public function __construct(
protected INotificationManager $notificationManager,
protected IGroupManager $groupManager,
protected IUserSession $userSession,
) {
}

/**
Expand Down
46 changes: 12 additions & 34 deletions lib/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,40 +44,18 @@ class Notifier implements INotifier {
public const SUBJECT_OBJECT_UPDATE = 'object_update';
public const SUBJECT_OBJECT_DELETE = 'object_delete';

/** @var IFactory */
protected $languageFactory;
/** @var ITimeFactory */
protected $timeFactory;
/** @var IL10N */
protected $l;
/** @var IURLGenerator */
protected $url;
/** @var IUserManager */
protected $userManager;
/** @var INotificationManager */
protected $notificationManager;
/** @var IAppManager */
protected $appManager;
/** @var IDateTimeFormatter */
protected $dateTimeFormatter;

/** @var string[] */
protected $userDisplayNames = [];

public function __construct(IFactory $languageFactory,
ITimeFactory $timeFactory,
IURLGenerator $url,
IUserManager $userManager,
INotificationManager $notificationManager,
IAppManager $appManager,
IDateTimeFormatter $dateTimeFormatter) {
$this->languageFactory = $languageFactory;
$this->timeFactory = $timeFactory;
$this->url = $url;
$this->userManager = $userManager;
$this->notificationManager = $notificationManager;
$this->appManager = $appManager;
$this->dateTimeFormatter = $dateTimeFormatter;
protected array $userDisplayNames = [];

public function __construct(
protected IFactory $languageFactory,
protected ITimeFactory $timeFactory,
protected IURLGenerator $url,
protected IUserManager $userManager,
protected INotificationManager $notificationManager,
protected IAppManager $appManager,
protected IDateTimeFormatter $dateTimeFormatter,
) {
}

/**
Expand All @@ -91,7 +69,7 @@ public function getID(): string {
}

/**
* Human readable name describing the notifier
* Human-readable name describing the notifier
*
* @return string
* @since 17.0.0
Expand Down