Skip to content

Commit 9b9d1ac

Browse files
kingjia90dvesh3
andauthored
[Bug]: Mailchimp Webhook newsletterManager by dependency injection (#433)
* task: use DI $newsletterManager in mailchimp webhook * task: update phpdoc * Apply php-cs-fixer changes * Revert DI and use getSubscribedServices for BC * Fix tests --------- Co-authored-by: kingjia90 <[email protected]> Co-authored-by: Divesh Pahuja <[email protected]>
1 parent 42bcf67 commit 9b9d1ac

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Controller/Rest/Mailchimp/WebhookController.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,19 @@
2929

3030
class WebhookController extends AbstractRestController
3131
{
32+
public static function getSubscribedServices(): array
33+
{
34+
$services = parent::getSubscribedServices();
35+
$services[NewsletterManagerInterface::class] = '?'.NewsletterManagerInterface::class;
36+
37+
return $services;
38+
}
39+
3240
/**
3341
* @param Request $request
42+
*
43+
* @return JsonResponse
44+
*
3445
* @Route("/mailchimp/webhook", methods={"GET","POST"})
3546
*/
3647
public function process(Request $request)

0 commit comments

Comments
 (0)