|
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
|
|
|
|
|
8
|
|
|
namespace ZBateson\MailMimeParser\Header; |
|
9
|
|
|
|
|
10
|
|
|
use ZBateson\MailMimeParser\Header\Part\MimeLiteralPartFactory; |
|
11
|
|
|
use ZBateson\MailMimeParser\Header\Consumer\IdBaseConsumerService; |
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* Represents a Content-ID, Message-ID, In-Reply-To or References header. |
|
15
|
|
|
* |
|
16
|
|
|
* For a multi-id header like In-Reply-To or References, all IDs can be |
|
17
|
|
|
* retrieved by calling {@see IdHeader::getIds()}. Otherwise, to retrieve the |
|
18
|
|
|
* first (or only) ID call {@see IdHeader::getValue()}. |
|
19
|
|
|
* |
|
20
|
|
|
* @author Zaahid Bateson |
|
21
|
|
|
*/ |
|
22
|
|
|
class IdHeader extends MimeEncodedHeader |
|
23
|
|
|
{ |
|
24
|
90 |
|
public function __construct( |
|
25
|
|
|
MimeLiteralPartFactory $mimeLiteralPartFactory, |
|
26
|
|
|
IdBaseConsumerService $consumerService, |
|
27
|
|
|
string $name, |
|
28
|
|
|
string $value |
|
29
|
|
|
) { |
|
30
|
90 |
|
parent::__construct($mimeLiteralPartFactory, $consumerService, $name, $value); |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* Returns the ID. Synonymous to calling getValue(). |
|
35
|
|
|
* |
|
36
|
|
|
* @return string|null The ID |
|
37
|
|
|
*/ |
|
38
|
|
|
public function getId() : ?string |
|
39
|
|
|
{ |
|
40
|
|
|
return $this->getValue(); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* Returns all IDs parsed for a multi-id header like References or |
|
45
|
|
|
* In-Reply-To. |
|
46
|
|
|
* |
|
47
|
|
|
* @return string[] An array of IDs |
|
48
|
|
|
*/ |
|
49
|
6 |
|
public function getIds() : array |
|
50
|
|
|
{ |
|
51
|
6 |
|
return \array_values(\array_map( |
|
52
|
6 |
|
function ($p) { |
|
53
|
5 |
|
return $p->getValue(); |
|
54
|
6 |
|
}, \array_filter($this->parts, function ($p) { |
|
55
|
5 |
|
return !($p instanceof CommentPart); |
|
|
|
|
|
|
56
|
6 |
|
}) |
|
57
|
6 |
|
)); |
|
58
|
|
|
} |
|
59
|
|
|
} |
|
60
|
|
|
|
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