Completed
Push — 1.0.0 ( 608796...a0ab23 )
by Zaahid
04:48
created

NonMimePartFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A newInstance() 0 5 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\Message\Part\Factory;
8
9
use Psr\Http\Message\StreamInterface;
10
use ZBateson\MailMimeParser\Message\Part\NonMimePart;
11
use ZBateson\MailMimeParser\Message\Part\PartBuilder;
12
13
/**
14
 * Responsible for creating NoneMimePart instances.
15
 *
16
 * @author Zaahid Bateson
17
 */
18
class NonMimePartFactory extends MessagePartFactory
19
{
20
    /**
21
     * Constructs a new NonMimePart object and returns it
22
     * 
23
     * @param StreamInterface $messageStream
24
     * @param PartBuilder $partBuilder
25
     * @return \ZBateson\MailMimeParser\Message\Part\NonMimePart
26
     */
27 1
    public function newInstance(StreamInterface $messageStream, PartBuilder $partBuilder) {
28 1
        return new NonMimePart(
29 1
            $this->partStreamFilterManagerFactory->newInstance(),
30 1
            $this->streamDecoratorFactory->getLimitedPartStream($messageStream, $partBuilder),
31 1
            $this->streamDecoratorFactory->getLimitedContentStream($messageStream, $partBuilder)
32
        );
33
    }
34
}
35