The default and testing mail classes are both in system.mail.inc, there doesn't seem to be a particular reason for this and they could equally live in /core/lib/Drupal/Core.

Comments

amateescu’s picture

Status: Active » Needs review
StatusFileSize
new17.96 KB

I had a small problem with this patch, about not being able to define a Default class in Drupal\Core\Mail because of PHP restrictions, so in lack of any better name, I renamed the default class to.. *drumroll*.. Mail :) Basically, DefaultMailSystem is now Drupal\Core\Mail\Mail.

I suppose we want to leave further clean-up of mail.inc to another issue? I'm thinking of a base class (abstract?) that will hold all the underscored functions that now reside in mail.inc.

Status: Needs review » Needs work

The last submitted patch, mail-psr0.patch, failed testing.

amateescu’s picture

Status: Needs work » Needs review
StatusFileSize
new693 bytes
new18.63 KB

Sigh..

Crell’s picture

Status: Needs review » Needs work
+++ b/core/lib/Drupal/Core/Mail/Mail.php
@@ -2,20 +2,23 @@
+class Mail implements MailInterface {

Yeah, I agree, silly name. :-) Could we perhaps call this something descriptive, like Sendmail, or PhpMail?

We don't have a Drupal\Core\Cache\Cache class for the default, we have a Drupal\Core\Cache\Database class for the default. That is more descriptive.

+++ b/core/lib/Drupal/Core/Mail/Testing.php
@@ -0,0 +1,30 @@
+class Testing extends Mail implements MailInterface {

This may not be the place to make this change, but "Testing" is a bad name for this class. It documents what it is often used for, not what it does. It should rather be something like VariableLog.

This looks good otherwise on visual inspection. Is there another inc file we can kill in the process? :-)

20 days to next Drupal core point release.

amateescu’s picture

Status: Needs work » Needs review
StatusFileSize
new3.55 KB
new18.7 KB

I like PhpMail and VariableLog, so went ahead with those names. Interdiff is against #3.

The only inc file left is mail.inc, which still contains some procedural stuff, but I think converting that to OO deserves a new issue.

Crell’s picture

I'm satisfied with #5, but it should probably get a second set of eyes on it before it goes RTBC.

catch’s picture

Status: Needs review » Reviewed & tested by the community

Both those class names look fine. mail.inc itself is definitely it's own issue.

I can't see anything to complain about here so I'm marking this RTBC, will leave it the usual 2-3 days before commit so people have a chance to object.

catch’s picture

Issue tags: -PSR-0

#5: mail-psr0-5.patch queued for re-testing.

Status: Reviewed & tested by the community » Needs work
Issue tags: +PSR-0

The last submitted patch, mail-psr0-5.patch, failed testing.

amateescu’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new18.68 KB

Rerolled for the system.info fail.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

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