Passed
Push — 1.0.x ( 8d2361...57bf95 )
by Koldo
02:43
created

GetFeaturesFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 8
ccs 4
cts 4
cp 1
crap 1
rs 10
c 2
b 0
f 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Pheature\Crud\Psr11\Toggle;
6
7
use Pheature\Core\Toggle\Read\FeatureFinder;
8
use Pheature\Crud\Psr7\Toggle\GetFeatures;
9
use Psr\Container\ContainerInterface;
10
use Psr\Http\Message\ResponseFactoryInterface;
11
12
final class GetFeaturesFactory
13
{
14 1
    public function __invoke(ContainerInterface $container): GetFeatures
15
    {
16
        /** @var FeatureFinder $featureFinder */
17 1
        $featureFinder = $container->get(FeatureFinder::class);
18
        /** @var ResponseFactoryInterface $responseFactory */
19 1
        $responseFactory = $container->get(ResponseFactoryInterface::class);
20
21 1
        return self::create($featureFinder, $responseFactory);
22
    }
23
24 2
    public static function create(FeatureFinder $featureFinder, ResponseFactoryInterface $responseFactory): GetFeatures
25
    {
26 2
        return new GetFeatures($featureFinder, $responseFactory);
27
    }
28
}
29