orderStatusChangedTrigger = $orderStatusChangedTrigger; $this->orderStatusChangeSubject = $orderStatusChangeSubject; $this->orderSubject = $orderSubject; $this->customerSubject = $customerSubject; $this->contextFactory = $contextFactory; } public function register(Registry $registry): void { $registry->addContextFactory('woocommerce', function () { return $this->contextFactory->getContextData(); }); $registry->addSubject($this->orderSubject); $registry->addSubject($this->orderStatusChangeSubject); $registry->addSubject($this->customerSubject); $registry->addTrigger($this->orderStatusChangedTrigger); } }