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

GetFeaturesFactory::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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