Completed
Push — master ( aab6ae...03b37f )
by Zaahid
04:44
created

MimePartFactory::newUUEncodedPart()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
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;
8
9
use ZBateson\MailMimeParser\Header\HeaderFactory;
10
11
/**
12
 * Description of MimePartFactory
13
 *
14
 * @author Zaahid Bateson
15
 */
16
class MimePartFactory
17
{
18
    /**
19
     * @var \ZBateson\MailMimeParser\Header\HeaderFactory the HeaderFactory
20
     *      instance
21
     */
22
    protected $headerFactory;
23
    
24
    /**
25
     * Creates a MimePartFactory instance with its dependencies.
26
     * 
27
     * @param HeaderFactory $headerFactory
28
     */
29
    public function __construct(HeaderFactory $headerFactory)
30
    {
31
        $this->headerFactory = $headerFactory;
32
    }
33
    
34
    /**
35
     * Constructs a new MimePart object and returns it
36
     * 
37
     * @return \ZBateson\MailMimeParser\MimePart
38
     */
39
    public function newMimePart()
40
    {
41
        return new MimePart($this->headerFactory);
42
    }
43
    
44
    /**
45
     * Constructs a new NonMimePart object and returns it
46
     * 
47
     * @return \ZBateson\MailMimeParser\NonMimePart
48
     */
49
    public function newNonMimePart()
50
    {
51
        return new NonMimePart($this->headerFactory);
52
    }
53
    
54
    /**
55
     * Constructs a new UUEncodedPart object and returns it
56
     * 
57
     * @param int $mode
58
     * @param string $filename
59
     */
60
    public function newUUEncodedPart($mode, $filename)
61
    {
62
        return new UUEncodedPart($this->headerFactory, $mode, $filename);
63
    }
64
}
65