1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Shlinkio\Shlink\CLI; |
||
6 | |||
7 | use Doctrine\DBAL\Connection; |
||
8 | use GeoIp2\Database\Reader; |
||
9 | use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory; |
||
10 | use Laminas\ServiceManager\Factory\InvokableFactory; |
||
11 | use Shlinkio\Shlink\CLI\Util\GeolocationDbUpdater; |
||
12 | use Shlinkio\Shlink\Common\Doctrine\NoDbNameConnectionFactory; |
||
13 | use Shlinkio\Shlink\Core\Domain\DomainService; |
||
14 | use Shlinkio\Shlink\Core\Service; |
||
15 | use Shlinkio\Shlink\Core\Tag\TagService; |
||
16 | use Shlinkio\Shlink\Core\Visit; |
||
17 | use Shlinkio\Shlink\Installer\Factory\ProcessHelperFactory; |
||
18 | use Shlinkio\Shlink\IpGeolocation\GeoLite2\DbUpdater; |
||
19 | use Shlinkio\Shlink\IpGeolocation\Resolver\IpLocationResolverInterface; |
||
20 | use Shlinkio\Shlink\Rest\Service\ApiKeyService; |
||
21 | use Symfony\Component\Console as SymfonyCli; |
||
22 | use Symfony\Component\Lock\LockFactory; |
||
23 | use Symfony\Component\Process\PhpExecutableFinder; |
||
24 | |||
25 | use const Shlinkio\Shlink\Core\LOCAL_LOCK_FACTORY; |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
26 | |||
27 | return [ |
||
28 | |||
29 | 'dependencies' => [ |
||
30 | 'factories' => [ |
||
31 | SymfonyCli\Application::class => Factory\ApplicationFactory::class, |
||
32 | SymfonyCli\Helper\ProcessHelper::class => ProcessHelperFactory::class, |
||
33 | PhpExecutableFinder::class => InvokableFactory::class, |
||
34 | |||
35 | GeolocationDbUpdater::class => ConfigAbstractFactory::class, |
||
36 | |||
37 | Command\ShortUrl\GenerateShortUrlCommand::class => ConfigAbstractFactory::class, |
||
38 | Command\ShortUrl\ResolveUrlCommand::class => ConfigAbstractFactory::class, |
||
39 | Command\ShortUrl\ListShortUrlsCommand::class => ConfigAbstractFactory::class, |
||
40 | Command\ShortUrl\GetVisitsCommand::class => ConfigAbstractFactory::class, |
||
41 | Command\ShortUrl\DeleteShortUrlCommand::class => ConfigAbstractFactory::class, |
||
42 | |||
43 | Command\Visit\LocateVisitsCommand::class => ConfigAbstractFactory::class, |
||
44 | |||
45 | Command\Api\GenerateKeyCommand::class => ConfigAbstractFactory::class, |
||
46 | Command\Api\DisableKeyCommand::class => ConfigAbstractFactory::class, |
||
47 | Command\Api\ListKeysCommand::class => ConfigAbstractFactory::class, |
||
48 | |||
49 | Command\Tag\ListTagsCommand::class => ConfigAbstractFactory::class, |
||
50 | Command\Tag\CreateTagCommand::class => ConfigAbstractFactory::class, |
||
51 | Command\Tag\RenameTagCommand::class => ConfigAbstractFactory::class, |
||
52 | Command\Tag\DeleteTagsCommand::class => ConfigAbstractFactory::class, |
||
53 | |||
54 | Command\Db\CreateDatabaseCommand::class => ConfigAbstractFactory::class, |
||
55 | Command\Db\MigrateDatabaseCommand::class => ConfigAbstractFactory::class, |
||
56 | |||
57 | Command\Domain\ListDomainsCommand::class => ConfigAbstractFactory::class, |
||
58 | ], |
||
59 | ], |
||
60 | |||
61 | ConfigAbstractFactory::class => [ |
||
62 | GeolocationDbUpdater::class => [DbUpdater::class, Reader::class, LOCAL_LOCK_FACTORY], |
||
63 | |||
64 | Command\ShortUrl\GenerateShortUrlCommand::class => [ |
||
65 | Service\UrlShortener::class, |
||
66 | 'config.url_shortener.domain', |
||
67 | 'config.url_shortener.default_short_codes_length', |
||
68 | ], |
||
69 | Command\ShortUrl\ResolveUrlCommand::class => [Service\ShortUrl\ShortUrlResolver::class], |
||
70 | Command\ShortUrl\ListShortUrlsCommand::class => [Service\ShortUrlService::class, 'config.url_shortener.domain'], |
||
71 | Command\ShortUrl\GetVisitsCommand::class => [Service\VisitsTracker::class], |
||
72 | Command\ShortUrl\DeleteShortUrlCommand::class => [Service\ShortUrl\DeleteShortUrlService::class], |
||
73 | |||
74 | Command\Visit\LocateVisitsCommand::class => [ |
||
75 | Visit\VisitLocator::class, |
||
76 | IpLocationResolverInterface::class, |
||
77 | LockFactory::class, |
||
78 | GeolocationDbUpdater::class, |
||
79 | ], |
||
80 | |||
81 | Command\Api\GenerateKeyCommand::class => [ApiKeyService::class], |
||
82 | Command\Api\DisableKeyCommand::class => [ApiKeyService::class], |
||
83 | Command\Api\ListKeysCommand::class => [ApiKeyService::class], |
||
84 | |||
85 | Command\Tag\ListTagsCommand::class => [TagService::class], |
||
86 | Command\Tag\CreateTagCommand::class => [TagService::class], |
||
87 | Command\Tag\RenameTagCommand::class => [TagService::class], |
||
88 | Command\Tag\DeleteTagsCommand::class => [TagService::class], |
||
89 | |||
90 | Command\Domain\ListDomainsCommand::class => [DomainService::class, 'config.url_shortener.domain.hostname'], |
||
91 | |||
92 | Command\Db\CreateDatabaseCommand::class => [ |
||
93 | LockFactory::class, |
||
94 | SymfonyCli\Helper\ProcessHelper::class, |
||
95 | PhpExecutableFinder::class, |
||
96 | Connection::class, |
||
97 | NoDbNameConnectionFactory::SERVICE_NAME, |
||
98 | ], |
||
99 | Command\Db\MigrateDatabaseCommand::class => [ |
||
100 | LockFactory::class, |
||
101 | SymfonyCli\Helper\ProcessHelper::class, |
||
102 | PhpExecutableFinder::class, |
||
103 | ], |
||
104 | ], |
||
105 | |||
106 | ]; |
||
107 |