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

ParserNonMimeMessageProxy::getNextPartStart()   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 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
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\Parser\Proxy;
8
9
/**
10
 * A bi-directional parser-to-part proxy for IMessage objects created by
11
 * NonMimeParser.
12
 *
13
 * @author Zaahid Bateson
14
 */
15
class ParserNonMimeMessageProxy extends ParserMessageProxy
16
{
17
    /**
18
     * @var int|null The next part's start position within the message's raw
19
     *      stream, or null if not set, not discovered, or there are no more
20
     *      parts.
21
     */
22
    protected $nextPartStart = null;
23
24
    /**
25
     * @var int The next part's unix file mode in a uu-encoded 'begin' line if
26
     *      exists, or null otherwise.
27
     */
28
    protected $nextPartMode = null;
29
30
    /**
31
     * @var string The next part's file name in a uu-encoded 'begin' line if
32
     *      exists, or null otherwise.
33
     */
34
    protected $nextPartFilename = null;
35
36
    /**
37
     * Returns the next part's start position within the message's raw stream,
38
     * or null if not set, not discovered, or there are no more parts under this
39
     * message.
40
     *
41
     * @return int|null The start position or null
42
     */
43 6
    public function getNextPartStart()
44
    {
45 6
        return $this->nextPartStart;
46
    }
47
48
    /**
49
     * Returns the next part's unix file mode in a uu-encoded 'begin' line if
50
     * one exists, or null otherwise.
51
     *
52
     * @return int|null The file mode or null
53
     */
54 5
    public function getNextPartMode()
55
    {
56 5
        return $this->nextPartMode;
57
    }
58
59
    /**
60
     * Returns the next part's filename in a uu-encoded 'begin' line if one
61
     * exists, or null otherwise.
62
     *
63
     * @return int|null The file name or null
64
     */
65 5
    public function getNextPartFilename()
66
    {
67 5
        return $this->nextPartFilename;
68
    }
69
70
    /**
71
     * Sets the next part's start position within the message's raw stream.
72
     *
73
     * @param int $nextPartStart
74
     */
75 5
    public function setNextPartStart($nextPartStart)
76
    {
77 5
        $this->nextPartStart = $nextPartStart;
78 5
    }
79
80
    /**
81
     * Sets the next part's unix file mode from its 'begin' line.
82
     *
83
     * @param int $nextPartMode
84
     */
85 5
    public function setNextPartMode($nextPartMode)
86
    {
87 5
        $this->nextPartMode = $nextPartMode;
88 5
    }
89
90
    /**
91
     * Sets the next part's filename from its 'begin' line.
92
     *
93
     * @param string $nextPartFilename
94
     */
95 5
    public function setNextPartFilename($nextPartFilename)
96
    {
97 5
        $this->nextPartFilename = $nextPartFilename;
98 5
    }
99
100
    /**
101
     * Sets the next part start position, file mode, and filename to null
102
     */
103 4
    public function clearNextPart()
104
    {
105 4
        $this->nextPartStart = null;
106 4
        $this->nextPartMode = null;
107 4
        $this->nextPartFilename = null;
108 4
    }
109
}
110