Passed
Pull Request — master (#171)
by Zaahid
06:32 queued 03:18
created

NonMimePart::getContentType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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