ReactApplicationFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 14 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Antidot\React;
6
7
use Antidot\Application\Http\RouteFactory;
8
use Antidot\Application\Http\Router;
9
use Antidot\Container\MiddlewareFactory;
10
use Psr\Container\ContainerInterface;
11
12
class ReactApplicationFactory
13
{
14 1
    public function __invoke(ContainerInterface $container): ReactApplication
15
    {
16
        /** @var Router $router */
17 1
        $router = $container->get(Router::class);
18
        /** @var MiddlewareFactory $middlewareFactory */
19 1
        $middlewareFactory = $container->get(MiddlewareFactory::class);
20
        /** @var RouteFactory $routeFactory */
21 1
        $routeFactory = $container->get(RouteFactory::class);
22
23 1
        return new ReactApplication(
24 1
            new MiddlewarePipeline(),
25
            $router,
26
            $middlewareFactory,
27
            $routeFactory
28
        );
29
    }
30
}
31