ReportingCloudFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 17
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * ReportingCloud Laminas Module
6
 *
7
 * Laminas Module for ReportingCloud Web API. Authored and supported by Text Control GmbH.
8
 *
9
 * @link      https://www.reporting.cloud to learn more about ReportingCloud
10
 * @link      https://git.io/JexF4 for the canonical source repository
11
 * @license   https://git.io/JexFB
12
 * @copyright © 2022 Text Control GmbH
13
 */
14
15
namespace TxTextControl\ReportingCloud\Mvc\Controller\Plugin;
16
17
use Laminas\ServiceManager\Factory\FactoryInterface;
18
use Psr\Container\ContainerExceptionInterface;
19
use Psr\Container\ContainerInterface;
20
use Psr\Container\NotFoundExceptionInterface;
21
use TxTextControl\ReportingCloud\ReportingCloud as TxTextControlReportingCloudReportingCloud;
22
23
/**
24
 * Class ReportingCloudFactory
25
 *
26
 * @package TxTextControl\ReportingCloud
27
 * @author  Jonathan Maron (@JonathanMaron)
28
 */
29
class ReportingCloudFactory implements FactoryInterface
30
{
31
    /**
32
     * @param ContainerInterface $container
33
     * @param string             $requestedName
34
     * @param array|null         $options
35
     *
36
     * @return ReportingCloud
37
     * @throws ContainerExceptionInterface
38
     * @throws NotFoundExceptionInterface
39
     */
40
    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null): ReportingCloud
41
    {
42
        $reportingCloud = $container->get('ReportingCloud');
43
        assert($reportingCloud instanceof TxTextControlReportingCloudReportingCloud);
44
45
        return new ReportingCloud($reportingCloud);
46
    }
47
}
48