AttachmentParserManagerFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
namespace AcMailer\Attachment;
5
6
use Interop\Container\ContainerInterface;
7
use Psr\Container;
8
9
class AttachmentParserManagerFactory
10
{
11
    /**
12
     * @param ContainerInterface $container
13
     * @return AttachmentParserManager
14
     * @throws Container\ContainerExceptionInterface
15
     * @throws Container\NotFoundExceptionInterface
16
     */
17
    public function __invoke(ContainerInterface $container): AttachmentParserManager
18
    {
19
        $config = $container->get('config');
20
        $attachmentParsers = $config['attachment_parsers'] ?? [];
21
22
        return new AttachmentParserManager($container, $attachmentParsers);
23
    }
24
}
25