Completed
Push — master ( 74fe50...0f19ea )
by Zaahid
09:04
created

NonMimePart::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
/**
3
 * This file is part of the ZBateson\MailMimeParser project.
4
 *
5
 * @license http://opensource.org/licenses/bsd-license.php BSD
6
 */
7
namespace ZBateson\MailMimeParser\Message;
8
9
use ZBateson\MailMimeParser\Header\HeaderFactory;
10
use ZBateson\MailMimeParser\Message\Writer\MimePartWriter;
11
12
/**
13
 * Represents part of a non-mime message.  The part could either be a plain text
14
 * part or a uuencoded attachment and could be extended for other pre-mime
15
 * message encoding types.
16
 * 
17
 * This allows clients to handle all messages as mime messages by providing a
18
 * Content-Type header.  NonMimePart returns text/plain.
19
 * 
20
 * @author Zaahid Bateson <[email protected]>
21
 */
22
class NonMimePart extends MimePart
23
{
24
    /**
25
     * Sets up a default Content-Type header of text/plain.
26
     * 
27
     * @param HeaderFactory $headerFactory
28
     * @param MimePartWriter $partWriter
29
     */
30 1
    public function __construct(HeaderFactory $headerFactory, MimePartWriter $partWriter)
31
    {
32 1
        parent::__construct($headerFactory, $partWriter);
33 1
        $this->setRawHeader('Content-Type', 'text/plain');
34 1
    }
35
}
36