Problem/Motivation
The MailgunHandler class provides a bunch of static helper methods, like 'status', 'checkLibrary', 'checkApiSettings' and 'validateKey'.
They work fine, however, static methods may not be easily mocked, replaces by service decorators etc.
Proposed resolution
Create new non-static versions of 'status', 'checkLibrary', 'checkApiSettings' and 'validateKey' methods; replace any usages of static \Drupal with DI.
Replace static methods implementation with:
\Drupal::service('mailgun.mail_handler')->METHOD_NAME($arguments);
Deprecate static methods.
Remaining tasks
Implementation.
User interface changes
None.
API changes
A bunch of public static methods will be deprecated but will still work, so no API breakage here.
Data model changes
None.
Comments
Comment #2
abrammDone.
Comment #4
matroskeenThanks! Looks good!
I've also applied small corrections to
mailgun_requirements().