|
2 | 2 |
|
3 | 3 | declare(strict_types=1); |
4 | 4 |
|
5 | | -use App\Middleware\ApiExceptionMiddleware; |
6 | | -use App\Model\Pet; |
7 | | -use App\Model\Vaccination; |
8 | | -use App\Odm\PetMapping; |
9 | | -use App\Odm\VaccinationMapping; |
10 | | -use App\Parsing\PetParsing; |
11 | | -use App\Repository\PetRepository; |
12 | | -use App\RequestHandler\Api\Crud\CreateRequestHandler; |
13 | | -use App\RequestHandler\Api\Crud\DeleteRequestHandler; |
14 | | -use App\RequestHandler\Api\Crud\ListRequestHandler; |
15 | | -use App\RequestHandler\Api\Crud\ReadRequestHandler; |
16 | | -use App\RequestHandler\Api\Crud\UpdateRequestHandler; |
17 | | -use App\RequestHandler\OpenapiRequestHandler; |
18 | | -use App\RequestHandler\PingRequestHandler; |
19 | | -use App\ServiceFactory\Command\CommandsFactory; |
20 | | -use App\ServiceFactory\DecodeEncode\TypeDecodersFactory; |
21 | | -use App\ServiceFactory\DecodeEncode\TypeEncodersFactory; |
22 | | -use App\ServiceFactory\Framework\ExceptionMiddlewareFactory; |
23 | | -use App\ServiceFactory\Framework\MiddlewaresFactory; |
24 | | -use App\ServiceFactory\Framework\RouteMatcherFactory; |
25 | | -use App\ServiceFactory\Framework\RouteMatcherMiddlewareFactory; |
26 | | -use App\ServiceFactory\Framework\RoutesByNameFactory; |
27 | | -use App\ServiceFactory\Framework\UrlGeneratorFactory; |
28 | | -use App\ServiceFactory\Http\ResponseFactoryFactory; |
29 | | -use App\ServiceFactory\Http\StreamFactoryFactory; |
30 | | -use App\ServiceFactory\Logger\LoggerFactory; |
31 | | -use App\ServiceFactory\Middleware\ApiExceptionMiddlewareFactory; |
32 | | -use App\ServiceFactory\Negotiation\AcceptNegotiatorSupportedMediaTypesFactory; |
33 | | -use App\ServiceFactory\Negotiation\ContentTypeNegotiatorSupportedMediaTypesFactory; |
34 | | -use App\ServiceFactory\Parsing\ParserFactory; |
35 | | -use App\ServiceFactory\Parsing\PetParsingFactory; |
36 | | -use App\ServiceFactory\Repository\PetRepositoryFactory; |
37 | | -use App\ServiceFactory\RequestHandler\Api\Crud\PetCreateRequestHandlerFactory; |
38 | | -use App\ServiceFactory\RequestHandler\Api\Crud\PetDeleteRequestHandlerFactory; |
39 | | -use App\ServiceFactory\RequestHandler\Api\Crud\PetListRequestHandlerFactory; |
40 | | -use App\ServiceFactory\RequestHandler\Api\Crud\PetReadRequestHandlerFactory; |
41 | | -use App\ServiceFactory\RequestHandler\Api\Crud\PetUpdateRequestHandlerFactory; |
42 | | -use App\ServiceFactory\RequestHandler\OpenapiRequestHandlerFactory; |
43 | | -use App\ServiceFactory\RequestHandler\PingRequestHandlerFactory; |
| 5 | +use App\Core\Middleware\ApiExceptionMiddleware; |
| 6 | +use App\Core\RequestHandler\Api\Crud\CreateRequestHandler; |
| 7 | +use App\Core\RequestHandler\Api\Crud\DeleteRequestHandler; |
| 8 | +use App\Core\RequestHandler\Api\Crud\ListRequestHandler; |
| 9 | +use App\Core\RequestHandler\Api\Crud\ReadRequestHandler; |
| 10 | +use App\Core\RequestHandler\Api\Crud\UpdateRequestHandler; |
| 11 | +use App\Core\RequestHandler\OpenapiRequestHandler; |
| 12 | +use App\Core\RequestHandler\PingRequestHandler; |
| 13 | +use App\Core\ServiceFactory\Command\CommandsFactory; |
| 14 | +use App\Core\ServiceFactory\DecodeEncode\TypeDecodersFactory; |
| 15 | +use App\Core\ServiceFactory\DecodeEncode\TypeEncodersFactory; |
| 16 | +use App\Core\ServiceFactory\Framework\ExceptionMiddlewareFactory; |
| 17 | +use App\Core\ServiceFactory\Framework\MiddlewaresFactory; |
| 18 | +use App\Core\ServiceFactory\Framework\RouteMatcherFactory; |
| 19 | +use App\Core\ServiceFactory\Framework\RouteMatcherMiddlewareFactory; |
| 20 | +use App\Core\ServiceFactory\Framework\RoutesByNameFactory; |
| 21 | +use App\Core\ServiceFactory\Framework\RoutesDelegator; |
| 22 | +use App\Core\ServiceFactory\Framework\RoutesFactory; |
| 23 | +use App\Core\ServiceFactory\Framework\UrlGeneratorFactory; |
| 24 | +use App\Core\ServiceFactory\Http\ResponseFactoryFactory; |
| 25 | +use App\Core\ServiceFactory\Http\StreamFactoryFactory; |
| 26 | +use App\Core\ServiceFactory\Logger\LoggerFactory; |
| 27 | +use App\Core\ServiceFactory\Middleware\ApiExceptionMiddlewareFactory; |
| 28 | +use App\Core\ServiceFactory\Negotiation\AcceptNegotiatorSupportedMediaTypesFactory; |
| 29 | +use App\Core\ServiceFactory\Negotiation\ContentTypeNegotiatorSupportedMediaTypesFactory; |
| 30 | +use App\Core\ServiceFactory\Parsing\ParserFactory; |
| 31 | +use App\Core\ServiceFactory\RequestHandler\OpenapiRequestHandlerFactory; |
| 32 | +use App\Core\ServiceFactory\RequestHandler\PingRequestHandlerFactory; |
| 33 | +use App\Pet\Model\Pet; |
| 34 | +use App\Pet\Model\Vaccination; |
| 35 | +use App\Pet\Odm\PetMapping; |
| 36 | +use App\Pet\Odm\VaccinationMapping; |
| 37 | +use App\Pet\Parsing\PetParsing; |
| 38 | +use App\Pet\Repository\PetRepository; |
| 39 | +use App\Pet\ServiceFactory\Framework\PetRoutesDelegator; |
| 40 | +use App\Pet\ServiceFactory\Parsing\PetParsingFactory; |
| 41 | +use App\Pet\ServiceFactory\Repository\PetRepositoryFactory; |
| 42 | +use App\Pet\ServiceFactory\RequestHandler\Api\Crud\PetCreateRequestHandlerFactory; |
| 43 | +use App\Pet\ServiceFactory\RequestHandler\Api\Crud\PetDeleteRequestHandlerFactory; |
| 44 | +use App\Pet\ServiceFactory\RequestHandler\Api\Crud\PetListRequestHandlerFactory; |
| 45 | +use App\Pet\ServiceFactory\RequestHandler\Api\Crud\PetReadRequestHandlerFactory; |
| 46 | +use App\Pet\ServiceFactory\RequestHandler\Api\Crud\PetUpdateRequestHandlerFactory; |
44 | 47 | use Chubbyphp\Cors\CorsMiddleware; |
45 | 48 | use Chubbyphp\Cors\ServiceFactory\CorsMiddlewareFactory; |
46 | 49 | use Chubbyphp\DecodeEncode\Decoder\DecoderInterface; |
|
51 | 54 | use Chubbyphp\DecodeEncode\ServiceFactory\EncoderFactory; |
52 | 55 | use Chubbyphp\Framework\Middleware\ExceptionMiddleware; |
53 | 56 | use Chubbyphp\Framework\Middleware\RouteMatcherMiddleware; |
| 57 | +use Chubbyphp\Framework\Router\RouteInterface; |
54 | 58 | use Chubbyphp\Framework\Router\RouteMatcherInterface; |
55 | 59 | use Chubbyphp\Framework\Router\RoutesByNameInterface; |
56 | 60 | use Chubbyphp\Framework\Router\UrlGeneratorInterface; |
|
76 | 80 | use Psr\Log\LoggerInterface; |
77 | 81 | use Symfony\Component\Console\Command\Command; |
78 | 82 |
|
79 | | -$rootDir = \realpath(__DIR__ . '/..'); |
80 | | -$cacheDir = $rootDir . '/var/cache/' . $env; |
81 | | -$logDir = $rootDir . '/var/log'; |
| 83 | +$rootDir = realpath(__DIR__.'/..'); |
| 84 | +$cacheDir = $rootDir.'/var/cache/'.$env; |
| 85 | +$logDir = $rootDir.'/var/log'; |
82 | 86 |
|
83 | 87 | return [ |
84 | 88 | 'chubbyphp' => [ |
|
95 | 99 | 'dependencies' => [ |
96 | 100 | 'factories' => [ |
97 | 101 | AcceptMiddleware::class => AcceptMiddlewareFactory::class, |
98 | | - AcceptNegotiatorInterface::class . 'supportedMediaTypes[]' => AcceptNegotiatorSupportedMediaTypesFactory::class, |
99 | | - AcceptNegotiatorInterface::class . 'supportedMediaTypes[]' => AcceptNegotiatorSupportedMediaTypesFactory::class, |
| 102 | + AcceptNegotiatorInterface::class.'supportedMediaTypes[]' => AcceptNegotiatorSupportedMediaTypesFactory::class, |
| 103 | + AcceptNegotiatorInterface::class.'supportedMediaTypes[]' => AcceptNegotiatorSupportedMediaTypesFactory::class, |
100 | 104 | AcceptNegotiatorInterface::class => AcceptNegotiatorFactory::class, |
101 | 105 | ApiExceptionMiddleware::class => ApiExceptionMiddlewareFactory::class, |
102 | 106 | CacheItemPoolInterface::class => ApcuAdapterFactory::class, |
103 | | - Command::class . '[]' => CommandsFactory::class, |
| 107 | + Command::class.'[]' => CommandsFactory::class, |
104 | 108 | ContentTypeMiddleware::class => ContentTypeMiddlewareFactory::class, |
105 | | - ContentTypeNegotiatorInterface::class . 'supportedMediaTypes[]' => ContentTypeNegotiatorSupportedMediaTypesFactory::class, |
| 109 | + ContentTypeNegotiatorInterface::class.'supportedMediaTypes[]' => ContentTypeNegotiatorSupportedMediaTypesFactory::class, |
106 | 110 | ContentTypeNegotiatorInterface::class => ContentTypeNegotiatorFactory::class, |
107 | 111 | CorsMiddleware::class => CorsMiddlewareFactory::class, |
108 | 112 | DecoderInterface::class => DecoderFactory::class, |
|
111 | 115 | ExceptionMiddleware::class => ExceptionMiddlewareFactory::class, |
112 | 116 | LoggerInterface::class => LoggerFactory::class, |
113 | 117 | MappingDriver::class => ClassMapDriverFactory::class, |
114 | | - MiddlewareInterface::class . '[]' => MiddlewaresFactory::class, |
115 | | - OpenapiRequestHandler::class => OpenapiRequestHandlerFactory::class, |
| 118 | + MiddlewareInterface::class.'[]' => MiddlewaresFactory::class, |
116 | 119 | OpenapiRequestHandler::class => OpenapiRequestHandlerFactory::class, |
117 | 120 | ParserInterface::class => ParserFactory::class, |
118 | | - Pet::class . CreateRequestHandler::class => PetCreateRequestHandlerFactory::class, |
119 | | - Pet::class . DeleteRequestHandler::class => PetDeleteRequestHandlerFactory::class, |
120 | | - Pet::class . ListRequestHandler::class => PetListRequestHandlerFactory::class, |
121 | | - Pet::class . ReadRequestHandler::class => PetReadRequestHandlerFactory::class, |
122 | | - Pet::class . UpdateRequestHandler::class => PetUpdateRequestHandlerFactory::class, |
| 121 | + Pet::class.CreateRequestHandler::class => PetCreateRequestHandlerFactory::class, |
| 122 | + Pet::class.DeleteRequestHandler::class => PetDeleteRequestHandlerFactory::class, |
| 123 | + Pet::class.ListRequestHandler::class => PetListRequestHandlerFactory::class, |
| 124 | + Pet::class.ReadRequestHandler::class => PetReadRequestHandlerFactory::class, |
| 125 | + Pet::class.UpdateRequestHandler::class => PetUpdateRequestHandlerFactory::class, |
123 | 126 | PetParsing::class => PetParsingFactory::class, |
124 | 127 | PetRepository::class => PetRepositoryFactory::class, |
125 | 128 | PingRequestHandler::class => PingRequestHandlerFactory::class, |
126 | 129 | ResponseFactoryInterface::class => ResponseFactoryFactory::class, |
127 | 130 | RouteMatcherInterface::class => RouteMatcherFactory::class, |
128 | 131 | RouteMatcherMiddleware::class => RouteMatcherMiddlewareFactory::class, |
129 | 132 | RoutesByNameInterface::class => RoutesByNameFactory::class, |
| 133 | + RouteInterface::class.'[]' => RoutesFactory::class, |
130 | 134 | StreamFactoryInterface::class => StreamFactoryFactory::class, |
131 | | - TypeDecoderInterface::class . '[]' => TypeDecodersFactory::class, |
132 | | - TypeEncoderInterface::class . '[]' => TypeEncodersFactory::class, |
| 135 | + TypeDecoderInterface::class.'[]' => TypeDecodersFactory::class, |
| 136 | + TypeEncoderInterface::class.'[]' => TypeEncodersFactory::class, |
133 | 137 | UrlGeneratorInterface::class => UrlGeneratorFactory::class, |
134 | 138 | ], |
| 139 | + 'delegators' => [ |
| 140 | + RouteInterface::class.'[]' => [ |
| 141 | + PetRoutesDelegator::class, |
| 142 | + RoutesDelegator::class, |
| 143 | + ], |
| 144 | + ], |
135 | 145 | ], |
136 | 146 | 'directories' => [ |
137 | 147 | 'cache' => $cacheDir, |
|
165 | 175 | 'mongodbOdm' => [ |
166 | 176 | 'configuration' => [ |
167 | 177 | 'metadataDriverImpl' => MappingDriver::class, |
168 | | - 'proxyDir' => $cacheDir . '/doctrine/mongodbOdm/proxies', |
| 178 | + 'proxyDir' => $cacheDir.'/doctrine/mongodbOdm/proxies', |
169 | 179 | 'proxyNamespace' => 'DoctrineMongoDBODMProxy', |
170 | | - 'hydratorDir' => $cacheDir . '/doctrine/mongodbOdm/hydrators', |
| 180 | + 'hydratorDir' => $cacheDir.'/doctrine/mongodbOdm/hydrators', |
171 | 181 | 'hydratorNamespace' => 'DoctrineMongoDBODMHydrators', |
172 | 182 | 'metadataCache' => CacheItemPoolInterface::class, |
173 | 183 | 'defaultDB' => 'petstore', |
174 | 184 | ], |
175 | 185 | ], |
176 | 186 | ], |
177 | 187 | 'fastroute' => [ |
178 | | - 'cache' => $cacheDir . '/router-cache.php', |
| 188 | + 'cache' => $cacheDir.'/router-cache.php', |
179 | 189 | ], |
180 | 190 | 'monolog' => [ |
181 | 191 | 'name' => 'petstore', |
182 | | - 'path' => $logDir . '/application.log', |
| 192 | + 'path' => $logDir.'/application.log', |
183 | 193 | 'level' => Level::Notice, |
184 | 194 | ], |
185 | 195 | ]; |
0 commit comments