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

GetFeaturesFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 3 1
A __invoke() 0 8 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