Test Failed
Pull Request — master (#171)
by Zaahid
04:32
created

PartBuilderFactory::newChildPartBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 4
c 2
b 0
f 0
dl 0
loc 6
rs 10
cc 1
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\Parser;
8
9
use ZBateson\MailMimeParser\Message\PartHeaderContainer;
10
use ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy;
11
use Psr\Http\Message\StreamInterface;
12
13
/**
14
 * Responsible for creating PartBuilder instances.
15
 *
16
 * @author Zaahid Bateson
17
 */
18
class PartBuilderFactory
19
{
20
    /**
21
     * Constructs a new PartBuilder object and returns it
22
     * 
23
     * @param StreamInterface $messageStream
24
     * @return PartBuilder
25
     */
26
    public function newPartBuilder(PartHeaderContainer $headerContainer, StreamInterface $messageStream)
27
    {
28
        return new PartBuilder($headerContainer, $messageStream);
29
    }
30
31
    /**
32
     * Constructs a new PartBuilder object and returns it
33
     *
34
     * @param ParserPartProxy $parent
35
     * @return PartBuilder
36
     */
37
    public function newChildPartBuilder(PartHeaderContainer $headerContainer, ParserPartProxy $parent)
38
    {
39
        return new PartBuilder(
40
            $headerContainer,
41
            null,
42
            $parent
43
        );
44
    }
45
}
46