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\Message\UUEncodedPart; |
10
|
|
|
use ZBateson\MailMimeParser\Parser\IParserFactory; |
11
|
|
|
use ZBateson\MailMimeParser\Parser\PartBuilder; |
12
|
|
|
use ZBateson\MailMimeParser\Parser\Part\ParsedPartStreamContainerFactory; |
13
|
|
|
use ZBateson\MailMimeParser\Stream\StreamFactory; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Responsible for creating ParsedUUEncodedPart instances. |
17
|
|
|
* |
18
|
|
|
* @author Zaahid Bateson |
19
|
|
|
*/ |
20
|
|
|
class ParserUUEncodedPartFactory |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* @var StreamFactory the StreamFactory instance |
24
|
|
|
*/ |
25
|
|
|
protected $streamFactory; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var ParsedPartStreamContainerFactory |
29
|
|
|
*/ |
30
|
|
|
protected $parsedPartStreamContainerFactory; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var IParserFactory |
34
|
|
|
*/ |
35
|
|
|
protected $parserFactory; |
36
|
|
|
|
37
|
|
|
public function __construct( |
38
|
|
|
StreamFactory $sdf, |
39
|
|
|
ParsedPartStreamContainerFactory $parsedPartStreamContainerFactory |
40
|
|
|
) { |
41
|
|
|
$this->streamFactory = $sdf; |
42
|
|
|
$this->parsedPartStreamContainerFactory = $parsedPartStreamContainerFactory; |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
public function setParserFactory(IParserFactory $parserFactory) |
46
|
|
|
{ |
47
|
|
|
$this->parserFactory = $parserFactory; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* Constructs a new IUUEncodedPart object and returns it |
52
|
|
|
* |
53
|
|
|
* @param PartBuilder $partBuilder |
54
|
|
|
* @return IUUEncodedPart |
|
|
|
|
55
|
|
|
*/ |
56
|
|
|
public function newInstance(PartBuilder $partBuilder, $mode, $filename, ParserMimePartProxy $parent) |
57
|
|
|
{ |
58
|
|
|
$parserProxy = new ParserUUEncodedPartProxy($partBuilder, $parent->getParser(), $parent); |
59
|
|
|
$streamContainer = $this->parsedPartStreamContainerFactory->newInstance($parserProxy); |
60
|
|
|
|
61
|
|
|
$part = new UUEncodedPart( |
62
|
|
|
$mode, |
63
|
|
|
$filename, |
64
|
|
|
$parent->getPart(), |
65
|
|
|
$streamContainer |
66
|
|
|
); |
67
|
|
|
$parserProxy->setPart($part); |
68
|
|
|
$parserProxy->setParsedPartStreamContainer($streamContainer); |
69
|
|
|
|
70
|
|
|
$streamContainer->setStream($this->streamFactory->newMessagePartStream($part)); |
71
|
|
|
$part->attach($streamContainer); |
72
|
|
|
|
73
|
|
|
$parent->addChild($parserProxy); |
74
|
|
|
return $part; |
75
|
|
|
} |
76
|
|
|
} |
77
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths