Passed
Push — master ( d57c11...8c6e4f )
by Joao
03:16 queued 36s
created

PHPMailerOverride::getFullMessageEnvelope()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
3
namespace ByJG\Mail\Override;
4
5
use ByJG\Mail\Exception\InvalidMessageFormatException;
6
7
class PHPMailerOverride extends \PHPMailer
8
{
9 8
    public function getFullMessageEnvelope()
10
    {
11 8
        $parts = $this->getMessageEnvelopeParts();
12
13 8
        return $parts['header'] . $parts['body'];
14
    }
15
16 8
    public function getMessageEnvelopeParts()
17
    {
18 8
        if (!$this->preSend()) {
19
            throw new InvalidMessageFormatException('Invalid Message Format');
20
        }
21
22 8
        return ["header" => $this->MIMEHeader, "body" => $this->MIMEBody];
23
    }
24
}
25