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

abramm created an issue. See original summary.

abramm’s picture

Assigned: abramm » Unassigned
Status: Active » Needs review
StatusFileSize
new8.07 KB

Done.

  • Matroskeen committed 91e022a on 8.x-1.x authored by abramm
    Issue #3030240 by abramm: Remove static MailHandler service methods
    
matroskeen’s picture

Status: Needs review » Fixed

Thanks! Looks good!

I've also applied small corrections to mailgun_requirements().

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.