mailchimp-bundle icon indicating copy to clipboard operation
mailchimp-bundle copied to clipboard

Update to Symfony 6.3 and PHP 8.1

Open czachor opened this issue 11 months ago • 0 comments

Hello, the bundle wasn't working for me with Symfony 6 and PHP 8.2, so I made the fork. I think it could be connected to https://github.com/welpdev/mailchimp-bundle/issues/31

What is done:

  1. PHP min. version set to 8.1.
  2. Symfony min. version set to 6.3. Probably will work with 7.0, but not tested.
  3. Controller is extending from Symfony\Bundle\FrameworkBundle\Controller\AbstractController instead of Symfony\Bundle\FrameworkBundle\Controller\AbstractController\Controller (not available in Symfony 6).
  4. Removed some deprecations.
  5. Code formatting (PSR).
  6. Commands: added returns (Command::SUCCESS).
  7. A few code micro-optimizations.
  8. Changed type comparison operators (!= -> !==).
  9. Added function's return types.
  10. Added property types.
  11. SubscriberEventand WebhookEvent: removed Symfony\Component\EventDispatcher\Event class (removed in Symfony 4?)
  12. routing.yaml: changed type: annotation to type: attributes.
  13. A lot of small changes related to language level / Symfony version upgrade.
  14. WelpMailchimpBundle extends Symfony\Component\HttpKernel\Bundle\AbstractBundle instead of Symfony\Component\HttpKernel\Bundle\Bundle.
  15. Added autowiring instead of manually getting services.

TODO:

  1. I didn't rebuild the tests: the original ones didn't work too well for me and it's a big TODO.
  2. Memory usage: syncing ~4000 users consumes a lot of memory. I'll do some tests, but I think using yield could be helpful.
  3. It's been a long time since I wrote a bundle, so there are probably a few things to improve. I'm open to suggestions and of course feel free to modify the code.

If you decide to merge, I thing it should be major release (a'la mentioned above 2.0), there are BC changes here.

Anyway it works perfect with my app syncing ~4000 users with Mailchimp.

czachor avatar Mar 05 '24 14:03 czachor