Test Failed
Push — 2.0 ( 4d4d2f...3431b8 )
by Zaahid
04:28
created

ParserPartProxy   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 18
c 1
b 0
f 0
dl 0
loc 68
rs 10
wmc 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A parseContent() 0 4 2
A __construct() 0 8 1
A setPart() 0 3 1
A getParent() 0 3 1
A getParser() 0 3 1
A setParsedPartStreamContainer() 0 3 1
A getPartBuilder() 0 3 1
A getPart() 0 3 1
A parseAll() 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\Proxy;
8
9
use ZBateson\MailMimeParser\Parser\PartBuilder;
10
use ZBateson\MailMimeParser\Parser\IParser;
11
use ZBateson\MailMimeParser\Message\IMessagePart;
12
use ZBateson\MailMimeParser\Parser\Part\ParsedPartStreamContainer;
13
14
/**
15
 * Description of ProxyPart
16
 *
17
 * @author Zaahid Bateson
18
 */
19
abstract class ParserPartProxy
20
{
21
    protected $partBuilder;
22
    protected $parser;
23
    protected $parent;
24
25
    protected $part;
26
    protected $parsedPartStreamContainer;
27
28
    public function __construct(
29
        PartBuilder $partBuilder,
30
        IParser $parser,
31
        ParserMimePartProxy $parent = null
32
    ) {
33
        $this->partBuilder = $partBuilder;
34
        $this->parser = $parser;
35
        $this->parent = $parent;
36
    }
37
38
    public function setPart($part)
39
    {
40
        $this->part = $part;
41
    }
42
43
    public function setParsedPartStreamContainer($parsedPartStreamContainer)
44
    {
45
        $this->parsedPartStreamContainer = $parsedPartStreamContainer;
46
    }
47
48
    public function getParser()
49
    {
50
        return $this->parser;
51
    }
52
53
    public function parseContent()
54
    {
55
        if (!$this->partBuilder->isContentParsed()) {
56
            $this->parser->parseContent($this);
57
        }
58
    }
59
60
    public function parseAll()
61
    {
62
        $this->parseContent();
63
    }
64
65
    /**
66
     * Returns this ProxyPart's parent.
67
     *
68
     * @return ProxyPart
0 ignored issues
show
Bug introduced by
The type ZBateson\MailMimeParser\Parser\Proxy\ProxyPart was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
69
     */
70
    public function getParent()
71
    {
72
        return $this->parent;
73
    }
74
75
    /**
76
     *
77
     * @return type
0 ignored issues
show
Bug introduced by
The type ZBateson\MailMimeParser\Parser\Proxy\type was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
78
     */
79
    public function getPart()
80
    {
81
        return $this->part;
82
    }
83
84
    public function getPartBuilder()
85
    {
86
        return $this->partBuilder;
87
    }
88
}
89