Passed
Push — master ( 240c83...03f39b )
by Mathias
06:41
created

UploadHandlerFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 4
dl 0
loc 7
rs 10
c 1
b 1
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Applications\Service;
6
7
8
use Applications\Entity\Application;
9
use Core\Service\FileManager;
10
use Doctrine\ODM\MongoDB\DocumentManager;
11
use Psr\Container\ContainerInterface;
12
13
class UploadHandlerFactory
14
{
15
    public function __invoke(ContainerInterface $container): UploadHandler
16
    {
17
        $dm = $container->get(DocumentManager::class);
18
        $fileManager = $container->get(FileManager::class);
19
        $appRepo = $dm->getRepository(Application::class);
20
21
        return new UploadHandler($dm, $fileManager, $appRepo);
22
    }
23
}