mailchimp-bundle
mailchimp-bundle copied to clipboard
Update to Symfony 6.3 and PHP 8.1
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:
- PHP min. version set to 8.1.
- Symfony min. version set to 6.3. Probably will work with 7.0, but not tested.
- Controller is extending from
Symfony\Bundle\FrameworkBundle\Controller\AbstractControllerinstead ofSymfony\Bundle\FrameworkBundle\Controller\AbstractController\Controller(not available in Symfony 6). - Removed some deprecations.
- Code formatting (PSR).
- Commands: added returns (
Command::SUCCESS). - A few code micro-optimizations.
- Changed type comparison operators (
!=->!==). - Added function's return types.
- Added property types.
-
SubscriberEventandWebhookEvent: removedSymfony\Component\EventDispatcher\Eventclass (removed in Symfony 4?) - routing.yaml: changed
type: annotationtotype: attributes. - A lot of small changes related to language level / Symfony version upgrade.
- WelpMailchimpBundle extends
Symfony\Component\HttpKernel\Bundle\AbstractBundleinstead ofSymfony\Component\HttpKernel\Bundle\Bundle. - Added autowiring instead of manually getting services. // UPDATE: this probably isn't a good idea: https://symfony.com/doc/current/service_container/autowiring.html#public-and-reusable-bundles
TODO:
- I didn't rebuild the tests: the original ones didn't work too well for me and it's a big TODO.
- Memory usage: syncing ~4000 users consumes a lot of memory. I'll do some tests, but I think using
yieldcould be helpful. - 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.