dependencies.config.php 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. declare(strict_types=1);
  3. namespace Shlinkio\Shlink\Rest;
  4. use Doctrine\DBAL\Connection;
  5. use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
  6. use Laminas\ServiceManager\Factory\InvokableFactory;
  7. use Mezzio\Router\Middleware\ImplicitOptionsMiddleware;
  8. use Psr\Log\LoggerInterface;
  9. use Shlinkio\Shlink\Core\Options\AppOptions;
  10. use Shlinkio\Shlink\Core\Service;
  11. use Shlinkio\Shlink\Rest\Service\ApiKeyService;
  12. return [
  13. 'dependencies' => [
  14. 'factories' => [
  15. ApiKeyService::class => ConfigAbstractFactory::class,
  16. Action\HealthAction::class => ConfigAbstractFactory::class,
  17. Action\ShortUrl\CreateShortUrlAction::class => ConfigAbstractFactory::class,
  18. Action\ShortUrl\SingleStepCreateShortUrlAction::class => ConfigAbstractFactory::class,
  19. Action\ShortUrl\EditShortUrlAction::class => ConfigAbstractFactory::class,
  20. Action\ShortUrl\DeleteShortUrlAction::class => ConfigAbstractFactory::class,
  21. Action\ShortUrl\ResolveShortUrlAction::class => ConfigAbstractFactory::class,
  22. Action\ShortUrl\ListShortUrlsAction::class => ConfigAbstractFactory::class,
  23. Action\ShortUrl\EditShortUrlTagsAction::class => ConfigAbstractFactory::class,
  24. Action\Visit\GetVisitsAction::class => ConfigAbstractFactory::class,
  25. Action\Tag\ListTagsAction::class => ConfigAbstractFactory::class,
  26. Action\Tag\DeleteTagsAction::class => ConfigAbstractFactory::class,
  27. Action\Tag\CreateTagsAction::class => ConfigAbstractFactory::class,
  28. Action\Tag\UpdateTagAction::class => ConfigAbstractFactory::class,
  29. ImplicitOptionsMiddleware::class => Middleware\EmptyResponseImplicitOptionsMiddlewareFactory::class,
  30. Middleware\BodyParserMiddleware::class => InvokableFactory::class,
  31. Middleware\CrossDomainMiddleware::class => InvokableFactory::class,
  32. Middleware\ShortUrl\CreateShortUrlContentNegotiationMiddleware::class => InvokableFactory::class,
  33. ],
  34. ],
  35. ConfigAbstractFactory::class => [
  36. ApiKeyService::class => ['em'],
  37. Action\HealthAction::class => [Connection::class, AppOptions::class, 'Logger_Shlink'],
  38. Action\ShortUrl\CreateShortUrlAction::class => [
  39. Service\UrlShortener::class,
  40. 'config.url_shortener.domain',
  41. 'Logger_Shlink',
  42. ],
  43. Action\ShortUrl\SingleStepCreateShortUrlAction::class => [
  44. Service\UrlShortener::class,
  45. ApiKeyService::class,
  46. 'config.url_shortener.domain',
  47. 'Logger_Shlink',
  48. ],
  49. Action\ShortUrl\EditShortUrlAction::class => [Service\ShortUrlService::class, 'Logger_Shlink'],
  50. Action\ShortUrl\DeleteShortUrlAction::class => [Service\ShortUrl\DeleteShortUrlService::class, 'Logger_Shlink'],
  51. Action\ShortUrl\ResolveShortUrlAction::class => [Service\UrlShortener::class, 'config.url_shortener.domain'],
  52. Action\Visit\GetVisitsAction::class => [Service\VisitsTracker::class, 'Logger_Shlink'],
  53. Action\ShortUrl\ListShortUrlsAction::class => [
  54. Service\ShortUrlService::class,
  55. 'config.url_shortener.domain',
  56. 'Logger_Shlink',
  57. ],
  58. Action\ShortUrl\EditShortUrlTagsAction::class => [Service\ShortUrlService::class, 'Logger_Shlink'],
  59. Action\Tag\ListTagsAction::class => [Service\Tag\TagService::class, LoggerInterface::class],
  60. Action\Tag\DeleteTagsAction::class => [Service\Tag\TagService::class, LoggerInterface::class],
  61. Action\Tag\CreateTagsAction::class => [Service\Tag\TagService::class, LoggerInterface::class],
  62. Action\Tag\UpdateTagAction::class => [Service\Tag\TagService::class, LoggerInterface::class],
  63. ],
  64. ];