Completed
Push — master ( 0913ed...15a2b1 )
by Mathias
21s queued 15s
created

ApiApplyControllerFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 11
ccs 0
cts 11
cp 0
rs 10
cc 1
nc 1
nop 3
crap 2
1
<?php
2
3
/**
4
 * YAWIK
5
 *
6
 * @filesource
7
 * @copyright 2020 CROSS Solution <https://www.cross-solution.de>
8
 * @license MIT
9
 */
10
11
declare(strict_types=1);
12
13
namespace Applications\Controller;
14
15
use Applications\Entity\Hydrator\ApiApplicationHydrator;
16
use Interop\Container\ContainerInterface;
17
18
/**
19
 * Factory for \Applications\Controller\ApiApplyController
20
 *
21
 * @author Mathias Gelhausen <[email protected]>
22
 * TODO: write tests
23
 */
24
class ApiApplyControllerFactory
25
{
26
    public function __invoke(
27
        ContainerInterface $container,
28
        ?string $requestedName = null,
29
        ?array $options = null
30
    ): ApiApplyController {
31
        $repositories = $container->get('repositories');
32
        return new ApiApplyController(
33
            $repositories->get('Applications'),
34
            $repositories->get('Jobs'),
35
            $container->get('forms')->get('Applications/Apply'),
36
            $container->get('HydratorManager')->get(ApiApplicationHydrator::class)
37
        );
38
    }
39
}
40