Code Duplication    Length = 11-19 lines in 3 locations

tests/php/Control/Email/EmailTest/TestMailer.php 2 locations

@@ 10-28 (lines=19) @@
7
class TestMailer extends Mailer
8
{
9
10
    public function sendHTML(
11
        $to,
12
        $from,
13
        $subject,
14
        $htmlContent,
15
        $attachedFiles = false,
16
        $customheaders = false,
17
        $plainContent = false
18
    ) {
19
        return array(
20
            'to' => $to,
21
            'from' => $from,
22
            'subject' => $subject,
23
            'content' => $htmlContent,
24
            'files' => $attachedFiles,
25
            'customheaders' => $customheaders,
26
            'plaincontent' => $plainContent
27
        );
28
    }
29
30
    public function sendPlain($to, $from, $subject, $plainContent, $attachedFiles = false, $customheaders = false)
31
    {
@@ 30-40 (lines=11) @@
27
        );
28
    }
29
30
    public function sendPlain($to, $from, $subject, $plainContent, $attachedFiles = false, $customheaders = false)
31
    {
32
        return array(
33
            'to' => $to,
34
            'from' => $from,
35
            'subject' => $subject,
36
            'content' => $plainContent,
37
            'files' => $attachedFiles,
38
            'customheaders' => $customheaders
39
        );
40
    }
41
}
42

src/Dev/TestMailer.php 1 location

@@ 23-39 (lines=17) @@
20
     * @param bool $customHeaders
21
     * @return bool|mixed
22
     */
23
    public function sendPlain($to, $from, $subject, $plainContent, $attachedFiles = false, $customHeaders = false)
24
    {
25
        $this->saveEmail([
26
            'Type' => 'plain',
27
            'To' => $to,
28
            'From' => $from,
29
            'Subject' => $subject,
30
31
            'Content' => $plainContent,
32
            'PlainContent' => $plainContent,
33
34
            'AttachedFiles' => $attachedFiles,
35
            'CustomHeaders' => $customHeaders,
36
        ]);
37
38
        return true;
39
    }
40
41
    /**
42
     * Send a multi-part HTML email