Passed
Pull Request — master (#171)
by Zaahid
03:23
created

ParserPartStreamContainerFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
c 0
b 0
f 0
dl 0
loc 14
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A newInstance() 0 2 1
A __construct() 0 3 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\Part;
8
9
use ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy;
10
use ZBateson\MailMimeParser\Stream\StreamFactory;
11
12
/**
13
 * Creates ParserPartStreamContainer instances.
14
 *
15
 * @author Zaahid Bateson
16
 */
17
class ParserPartStreamContainerFactory
18
{
19
    /**
20
     * @var StreamFactory
21
     */
22
    protected $streamFactory;
23
24 1
    public function __construct(StreamFactory $streamFactory)
25
    {
26 1
        $this->streamFactory = $streamFactory;
27 1
    }
28
29 104
    public function newInstance(ParserPartProxy $parserProxy) {
30 104
        return new ParserPartStreamContainer($this->streamFactory, $parserProxy);
31
    }
32
}
33