|
5 | 5 | * @license http://opensource.org/licenses/bsd-license.php BSD |
6 | 6 | */ |
7 | 7 |
|
| 8 | +use DI\Definition\Helper\AutowireDefinitionHelper; |
| 9 | +use DI\Definition\Reference; |
8 | 10 | use Psr\Log\LoggerInterface; |
9 | 11 | use Psr\Log\NullLogger; |
10 | 12 | use ZBateson\MailMimeParser\Header\Consumer\Received\DomainConsumerService; |
|
16 | 18 | use ZBateson\MailMimeParser\Stream\StreamFactory; |
17 | 19 |
|
18 | 20 | return [ |
19 | | - LoggerInterface::class => DI\autowire(NullLogger::class), |
| 21 | + LoggerInterface::class => new AutowireDefinitionHelper(NullLogger::class), |
20 | 22 |
|
21 | 23 | // only affects reading part content, not for instance decoding mime encoded |
22 | 24 | // header parts |
23 | 25 | 'throwExceptionReadingPartContentFromUnsupportedCharsets' => false, |
24 | 26 |
|
25 | | - 'fromDomainConsumerService' => DI\autowire(DomainConsumerService::class) |
| 27 | + 'fromDomainConsumerService' => (new AutowireDefinitionHelper(DomainConsumerService::class)) |
26 | 28 | ->constructorParameter('partName', 'from'), |
27 | | - 'byDomainConsumerService' => DI\autowire(DomainConsumerService::class) |
| 29 | + 'byDomainConsumerService' => (new AutowireDefinitionHelper(DomainConsumerService::class)) |
28 | 30 | ->constructorParameter('partName', 'by'), |
29 | | - 'viaGenericReceivedConsumerService' => DI\autowire(GenericReceivedConsumerService::class) |
| 31 | + 'viaGenericReceivedConsumerService' => (new AutowireDefinitionHelper(GenericReceivedConsumerService::class)) |
30 | 32 | ->constructorParameter('partName', 'via'), |
31 | | - 'withGenericReceivedConsumerService' => DI\autowire(GenericReceivedConsumerService::class) |
| 33 | + 'withGenericReceivedConsumerService' => (new AutowireDefinitionHelper(GenericReceivedConsumerService::class)) |
32 | 34 | ->constructorParameter('partName', 'with'), |
33 | | - 'idGenericReceivedConsumerService' => DI\autowire(GenericReceivedConsumerService::class) |
| 35 | + 'idGenericReceivedConsumerService' => (new AutowireDefinitionHelper(GenericReceivedConsumerService::class)) |
34 | 36 | ->constructorParameter('partName', 'id'), |
35 | | - 'forGenericReceivedConsumerService' => DI\autowire(GenericReceivedConsumerService::class) |
| 37 | + 'forGenericReceivedConsumerService' => (new AutowireDefinitionHelper(GenericReceivedConsumerService::class)) |
36 | 38 | ->constructorParameter('partName', 'for'), |
37 | | - ReceivedConsumerService::class => DI\autowire() |
| 39 | + ReceivedConsumerService::class => (new AutowireDefinitionHelper()) |
38 | 40 | ->constructor( |
39 | | - fromDomainConsumerService: DI\get('fromDomainConsumerService'), |
40 | | - byDomainConsumerService: DI\get('byDomainConsumerService'), |
41 | | - viaGenericReceivedConsumerService: DI\get('viaGenericReceivedConsumerService'), |
42 | | - withGenericReceivedConsumerService: DI\get('withGenericReceivedConsumerService'), |
43 | | - idGenericReceivedConsumerService: DI\get('idGenericReceivedConsumerService'), |
44 | | - forGenericReceivedConsumerService: DI\get('forGenericReceivedConsumerService') |
| 41 | + fromDomainConsumerService: new Reference('fromDomainConsumerService'), |
| 42 | + byDomainConsumerService: new Reference('byDomainConsumerService'), |
| 43 | + viaGenericReceivedConsumerService: new Reference('viaGenericReceivedConsumerService'), |
| 44 | + withGenericReceivedConsumerService: new Reference('withGenericReceivedConsumerService'), |
| 45 | + idGenericReceivedConsumerService: new Reference('idGenericReceivedConsumerService'), |
| 46 | + forGenericReceivedConsumerService: new Reference('forGenericReceivedConsumerService') |
45 | 47 | ), |
46 | | - PartStreamContainer::class => DI\autowire() |
| 48 | + PartStreamContainer::class => (new AutowireDefinitionHelper()) |
47 | 49 | ->constructor( |
48 | | - throwExceptionReadingPartContentFromUnsupportedCharsets: DI\get('throwExceptionReadingPartContentFromUnsupportedCharsets') |
| 50 | + throwExceptionReadingPartContentFromUnsupportedCharsets: new Reference('throwExceptionReadingPartContentFromUnsupportedCharsets') |
49 | 51 | ), |
50 | | - PartStreamContainerFactory::class => DI\autowire() |
| 52 | + PartStreamContainerFactory::class => (new AutowireDefinitionHelper()) |
51 | 53 | ->constructor( |
52 | | - throwExceptionReadingPartContentFromUnsupportedCharsets: DI\get('throwExceptionReadingPartContentFromUnsupportedCharsets') |
| 54 | + throwExceptionReadingPartContentFromUnsupportedCharsets: new Reference('throwExceptionReadingPartContentFromUnsupportedCharsets') |
53 | 55 | ), |
54 | | - ParserPartStreamContainerFactory::class => DI\autowire() |
| 56 | + ParserPartStreamContainerFactory::class => (new AutowireDefinitionHelper()) |
55 | 57 | ->constructor( |
56 | | - throwExceptionReadingPartContentFromUnsupportedCharsets: DI\get('throwExceptionReadingPartContentFromUnsupportedCharsets') |
| 58 | + throwExceptionReadingPartContentFromUnsupportedCharsets: new Reference('throwExceptionReadingPartContentFromUnsupportedCharsets') |
57 | 59 | ), |
58 | | - StreamFactory::class => DI\autowire() |
| 60 | + StreamFactory::class => (new AutowireDefinitionHelper()) |
59 | 61 | ->constructor( |
60 | | - throwExceptionReadingPartContentFromUnsupportedCharsets: DI\get('throwExceptionReadingPartContentFromUnsupportedCharsets') |
| 62 | + throwExceptionReadingPartContentFromUnsupportedCharsets: new Reference('throwExceptionReadingPartContentFromUnsupportedCharsets') |
61 | 63 | ), |
62 | 64 | ]; |
0 commit comments