Completed
Pull Request — master (#588)
by Mathias
07:35
created

ApiApplyControllerFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 10
ccs 0
cts 10
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 Interop\Container\ContainerInterface;
16
17
/**
18
 * Factory for \Applications\Controller\ApiApplyController
19
 *
20
 * @author Mathias Gelhausen <[email protected]>
21
 * TODO: write tests
22
 */
23
class ApiApplyControllerFactory
24
{
25
    public function __invoke(
26
        ContainerInterface $container,
27
        ?string $requestedName = null,
28
        ?array $options = null
29
    ): ApiApplyController {
30
        $repositories = $container->get('repositories');
31
        return new ApiApplyController(
32
            $repositories->get('Applications'),
33
            $repositories->get('Jobs'),
34
            $container->get('forms')->get('Applications/Apply')
35
        );
36
37
    }
38
}
39