userSubject = $userSubject; $this->commentSubject = $commentSubject; $this->postSubject = $postSubject; $this->commentToPost = $commentToPost; $this->contextFactory = $contextFactory; } public function register(Registry $registry): void { $registry->addSubject($this->userSubject); $registry->addSubject($this->commentSubject); $registry->addSubject($this->postSubject); $registry->addSubjectTransformer($this->commentToPost); $registry->addContextFactory('wordpress', [$this->contextFactory, 'getContextData']); } }