|
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
|
|
|
|