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

ApiApplicationHydratorFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 2
b 0
f 0
dl 0
loc 14
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 12 1
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
namespace Applications\Entity\Hydrator;
13
14
use Interop\Container\ContainerInterface;
15
16
/**
17
 * Factory for \Applications\Entity\Hydrator\ApiApplicationHydrator
18
 *
19
 * @author Mathias Gelhausen <[email protected]>
20
 * TODO: write tests
21
 */
22
class ApiApplicationHydratorFactory
23
{
24
    public function __invoke(
25
        ContainerInterface $container,
26
        ?string $requestedName = null,
27
        ?array $options = null
28
    ): ApiApplicationHydrator {
29
        $hydrator =  new ApiApplicationHydrator();
30
31
        $hydrator->setServerURl(
32
            $container->get('ViewHelperManager')->get('serverurl')->__invoke()
33
        );
34
35
        return $hydrator;
36
    }
37
}
38