ConfigProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 14
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDependencies() 0 14 1
A __invoke() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WShafer\Mezzio\Symfony\Router;
6
7
use Mezzio\Router\RouterInterface;
8
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
9
use Symfony\Component\Routing\Generator\UrlGenerator;
10
use Symfony\Component\Routing\Matcher\UrlMatcher;
11
use Symfony\Component\Routing\RequestContext;
12
use Symfony\Component\Routing\RouteCollection;
13
use WShafer\Mezzio\Symfony\Router\Cache\Cache;
14
use WShafer\Mezzio\Symfony\Router\Cache\CacheFactory;
15
use WShafer\Mezzio\Symfony\Router\Container\HttpFoundationFactoryFactory;
16
use WShafer\Mezzio\Symfony\Router\Container\RequestContextFactory;
17
use WShafer\Mezzio\Symfony\Router\Container\RouteCollectionFactory;
18
use WShafer\Mezzio\Symfony\Router\Container\UrlGeneratorFactory;
19
use WShafer\Mezzio\Symfony\Router\Container\UrlMatcherFactory;
20
21
/**
22
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
23
 */
24
class ConfigProvider
25
{
26
    public function __invoke(): array
27
    {
28
        return [
29
            'dependencies' => $this->getDependencies(),
30
        ];
31
    }
32
33
    public function getDependencies(): array
34
    {
35
        return [
36
            'aliases' => [
37
                RouterInterface::class => SymfonyRouteRouter::class,
38
            ],
39
            'factories' => [
40
                SymfonyRouteRouter::class => SymfonyRouteRouterFactory::class,
41
                HttpFoundationFactory::class => HttpFoundationFactoryFactory::class,
42
                RequestContext::class => RequestContextFactory::class,
43
                UrlMatcher::class => UrlMatcherFactory::class,
44
                UrlGenerator::class => UrlGeneratorFactory::class,
45
                RouteCollection::class => RouteCollectionFactory::class,
46
                Cache::class => CacheFactory::class
47
            ],
48
        ];
49
    }
50
}
51