Passed
Push — master ( a0eabd...66d82e )
by Zaahid
03:20
created

NonMimePart::getContentId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
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\Part;
8
9
/**
10
 * Represents part of a non-mime message.  The part could either be a plain text
11
 * part or a uuencoded attachment and could be extended for other pre-mime
12
 * message encoding types.
13
 * 
14
 * This allows clients to handle all messages as mime messages by providing a
15
 * Content-Type header.  NonMimePart returns text/plain.
16
 * 
17
 * @author Zaahid Bateson
18
 */
19
class NonMimePart extends MessagePart
20
{
21
    /**
22
     * Returns true.
23
     * 
24
     * @return bool
25
     */
26 1
    public function isTextPart()
27
    {
28 1
        return true;
29
    }
30
    
31
    /**
32
     * Returns text/plain
33
     * 
34
     * @return string
35
     */
36 1
    public function getContentType()
37
    {
38 1
        return 'text/plain';
39
    }
40
    
41
    /**
42
     * Returns ISO-8859-1
43
     * 
44
     * @return string
45
     */
46 1
    public function getCharset()
47
    {
48 1
        return 'ISO-8859-1';
49
    }
50
    
51
    /**
52
     * Returns 'inline'.
53
     * 
54
     * @return string
55
     */
56 1
    public function getContentDisposition()
57
    {
58 1
        return 'inline';
59
    }
60
    
61
    /**
62
     * Returns '7bit'.
63
     * 
64
     * @return string
65
     */
66 1
    public function getContentTransferEncoding()
67
    {
68 1
        return '7bit';
69
    }
70
    
71
    /**
72
     * Returns false.
73
     * 
74
     * @return bool
75
     */
76 1
    public function isMime()
77
    {
78 1
        return false;
79
    }
80
81
    /**
82
     * Returns the Content ID of the part.
83
     *
84
     * NonMimeParts do not have a Content ID, and so this simply returns null.
85
     *
86
     * @return string|null
87
     */
88
    public function getContentId()
89
    {
90
        return null;
91
    }
92
}
93