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

PartHeaderContainerFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
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 25
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A newInstance() 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\Message\Factory;
8
9
use ZBateson\MailMimeParser\Header\HeaderFactory;
10
use ZBateson\MailMimeParser\Message\PartHeaderContainer;
11
12
/**
13
 * Creates PartHeaderContainer instances.
14
 *
15
 * @author Zaahid Bateson
16
 */
17
class PartHeaderContainerFactory
18
{
19
    /**
20
     * @var HeaderFactory the HeaderFactory passed to HeaderContainer instances.
21
     */
22
    protected $headerFactory;
23
24
    /**
25
     * Constructor
26
     *
27
     * @param HeaderFactory $headerFactory
28
     */
29 2
    public function __construct(HeaderFactory $headerFactory)
30
    {
31 2
        $this->headerFactory = $headerFactory;
32 2
    }
33
34
    /**
35
     * Creates and returns a PartHeaderContainer.
36
     *
37
     * @return PartHeaderContainer;
38
     */
39 105
    public function newInstance(PartHeaderContainer $from = null)
40
    {
41 105
        return new PartHeaderContainer($this->headerFactory, $from);
42
    }
43
}
44