|
|
|
@ -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.'
|
|
|
|
|