ConfigProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 27
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 1
A getDependencies() 0 17 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WShafer\Expressive\Symfony\Router;
6
7
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
8
use Symfony\Component\Routing\Generator\UrlGenerator;
9
use Symfony\Component\Routing\Matcher\UrlMatcher;
10
use Symfony\Component\Routing\RequestContext;
11
use Symfony\Component\Routing\RouteCollection;
12
use WShafer\Expressive\Symfony\Router\Cache\Cache;
13
use WShafer\Expressive\Symfony\Router\Cache\CacheFactory;
14
use WShafer\Expressive\Symfony\Router\Container\HttpFoundationFactoryFactory;
15
use WShafer\Expressive\Symfony\Router\Container\RequestContextFactory;
16
use WShafer\Expressive\Symfony\Router\Container\RouteCollectionFactory;
17
use WShafer\Expressive\Symfony\Router\Container\UrlGeneratorFactory;
18
use WShafer\Expressive\Symfony\Router\Container\UrlMatcherFactory;
19
use Zend\Expressive\Router\RouterInterface;
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