-
-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathdi_config.php
64 lines (60 loc) · 3.54 KB
/
di_config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* This file is part of the ZBateson\MailMimeParser project.
*
* @license http://opensource.org/licenses/bsd-license.php BSD
*/
use DI\Definition\Helper\AutowireDefinitionHelper;
use DI\Definition\Reference;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use ZBateson\MailMimeParser\Header\Consumer\Received\DomainConsumerService;
use ZBateson\MailMimeParser\Header\Consumer\Received\GenericReceivedConsumerService;
use ZBateson\MailMimeParser\Header\Consumer\ReceivedConsumerService;
use ZBateson\MailMimeParser\Message\Factory\PartStreamContainerFactory;
use ZBateson\MailMimeParser\Message\PartStreamContainer;
use ZBateson\MailMimeParser\Parser\Part\ParserPartStreamContainerFactory;
use ZBateson\MailMimeParser\Stream\StreamFactory;
return [
LoggerInterface::class => new AutowireDefinitionHelper(NullLogger::class),
// only affects reading part content, not for instance decoding mime encoded
// header parts
'throwExceptionReadingPartContentFromUnsupportedCharsets' => false,
'fromDomainConsumerService' => (new AutowireDefinitionHelper(DomainConsumerService::class))
->constructorParameter('partName', 'from'),
'byDomainConsumerService' => (new AutowireDefinitionHelper(DomainConsumerService::class))
->constructorParameter('partName', 'by'),
'viaGenericReceivedConsumerService' => (new AutowireDefinitionHelper(GenericReceivedConsumerService::class))
->constructorParameter('partName', 'via'),
'withGenericReceivedConsumerService' => (new AutowireDefinitionHelper(GenericReceivedConsumerService::class))
->constructorParameter('partName', 'with'),
'idGenericReceivedConsumerService' => (new AutowireDefinitionHelper(GenericReceivedConsumerService::class))
->constructorParameter('partName', 'id'),
'forGenericReceivedConsumerService' => (new AutowireDefinitionHelper(GenericReceivedConsumerService::class))
->constructorParameter('partName', 'for'),
ReceivedConsumerService::class => (new AutowireDefinitionHelper())
->constructor(
fromDomainConsumerService: new Reference('fromDomainConsumerService'),
byDomainConsumerService: new Reference('byDomainConsumerService'),
viaGenericReceivedConsumerService: new Reference('viaGenericReceivedConsumerService'),
withGenericReceivedConsumerService: new Reference('withGenericReceivedConsumerService'),
idGenericReceivedConsumerService: new Reference('idGenericReceivedConsumerService'),
forGenericReceivedConsumerService: new Reference('forGenericReceivedConsumerService')
),
PartStreamContainer::class => (new AutowireDefinitionHelper())
->constructor(
throwExceptionReadingPartContentFromUnsupportedCharsets: new Reference('throwExceptionReadingPartContentFromUnsupportedCharsets')
),
PartStreamContainerFactory::class => (new AutowireDefinitionHelper())
->constructor(
throwExceptionReadingPartContentFromUnsupportedCharsets: new Reference('throwExceptionReadingPartContentFromUnsupportedCharsets')
),
ParserPartStreamContainerFactory::class => (new AutowireDefinitionHelper())
->constructor(
throwExceptionReadingPartContentFromUnsupportedCharsets: new Reference('throwExceptionReadingPartContentFromUnsupportedCharsets')
),
StreamFactory::class => (new AutowireDefinitionHelper())
->constructor(
throwExceptionReadingPartContentFromUnsupportedCharsets: new Reference('throwExceptionReadingPartContentFromUnsupportedCharsets')
),
];