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 Psr\Log\LoggerInterface; |
||||||
11 | use ZBateson\MailMimeParser\Header\Consumer\GenericConsumerMimeLiteralPartService; |
||||||
12 | use ZBateson\MailMimeParser\MailMimeParser; |
||||||
13 | |||||||
14 | /** |
||||||
15 | * Reads a generic header. |
||||||
16 | * |
||||||
17 | * Header's may contain mime-encoded parts, quoted parts, and comments. The |
||||||
18 | * string value is the combined value of all its parts. |
||||||
19 | * |
||||||
20 | * @author Zaahid Bateson |
||||||
21 | */ |
||||||
22 | class GenericHeader extends AbstractHeader |
||||||
23 | { |
||||||
24 | 104 | public function __construct( |
|||||
25 | string $name, |
||||||
26 | string $value, |
||||||
27 | ?LoggerInterface $logger = null, |
||||||
28 | ?GenericConsumerMimeLiteralPartService $consumerService = null |
||||||
29 | ) { |
||||||
30 | 104 | $di = MailMimeParser::getGlobalContainer(); |
|||||
31 | 104 | parent::__construct( |
|||||
32 | 104 | $logger ?? $di->get(LoggerInterface::class), |
|||||
33 | 104 | $consumerService ?? $di->get(DateConsumerService::class), |
|||||
0 ignored issues
–
show
|
|||||||
34 | 104 | $name, |
|||||
35 | 104 | $value |
|||||
36 | 104 | ); |
|||||
37 | 104 | parent::__construct($logger, $consumerService, $name, $value); |
|||||
0 ignored issues
–
show
It seems like
$logger can also be of type null ; however, parameter $logger of ZBateson\MailMimeParser\...ctHeader::__construct() does only seem to accept Psr\Log\LoggerInterface , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() It seems like
$consumerService can also be of type null ; however, parameter $consumerService of ZBateson\MailMimeParser\...ctHeader::__construct() does only seem to accept ZBateson\MailMimeParser\...nsumer\IConsumerService , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
38 | } |
||||||
39 | |||||||
40 | 101 | public function getValue() : ?string |
|||||
41 | { |
||||||
42 | 101 | if (!empty($this->parts)) { |
|||||
43 | 101 | return \implode('', \array_map(function($p) { return $p->getValue(); }, $this->parts)); |
|||||
0 ignored issues
–
show
|
|||||||
44 | } |
||||||
45 | return null; |
||||||
46 | } |
||||||
47 | } |
||||||
48 |
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