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

PartBuilderFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 4
b 0
f 0
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A newPartBuilder() 0 3 1
A newChildPartBuilder() 0 6 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;
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