*/ class CommentSubject implements Subject { const KEY = 'wordpress:comment'; /** @var WordPress */ private $wp; public function __construct( WordPress $wp ) { $this->wp = $wp; } public function getKey(): string { return self::KEY; } public function getName(): string { return __('Comment', 'mailpoet'); } public function getArgsSchema(): ObjectSchema { return Builder::object([ 'comment_id' => Builder::integer()->required(), ]); } public function getFields(): array { return []; } public function getPayload(SubjectData $subjectData): Payload { $commentId = (int)$subjectData->getArgs()['comment_id']; return new CommentPayload($commentId, $this->wp); } }