Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 23
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
ClientConfigServiceProvider
0.00% covered (danger)
0.00%
0 / 23
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 __invoke
0.00% covered (danger)
0.00%
0 / 23
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3/**
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; under version 2
7 * of the License (non-upgradable).
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 *
18 * Copyright (c) 2023 (original work) Open Assessment Technologies SA.
19 *
20 * @author Andrei Shapiro <andrei.shapiro@taotesting.com>
21 */
22
23declare(strict_types=1);
24
25namespace oat\tao\model\clientConfig;
26
27use common_ext_ExtensionsManager;
28use oat\generis\model\DependencyInjection\ContainerServiceProviderInterface;
29use oat\oatbox\log\LoggerService;
30use oat\oatbox\session\SessionService;
31use oat\oatbox\user\UserLanguageServiceInterface;
32use oat\tao\helpers\dateFormatter\DateFormatterFactory;
33use oat\tao\model\asset\AssetService;
34use oat\tao\model\ClientLibRegistry;
35use oat\tao\model\CookiePolicy\Service\CookiePolicyConfigurationRetriever;
36use oat\tao\model\featureFlag\FeatureFlagConfigSwitcher;
37use oat\tao\model\featureFlag\Repository\FeatureFlagRepositoryInterface;
38use oat\tao\model\menu\MenuService;
39use oat\tao\model\routing\ResolverFactory;
40use oat\tao\model\security\xsrf\TokenService;
41use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
42use tao_helpers_Mode;
43
44use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
45
46class ClientConfigServiceProvider implements ContainerServiceProviderInterface
47{
48    public function __invoke(ContainerConfigurator $configurator): void
49    {
50        $services = $configurator->services();
51
52        $services
53            ->set(ClientConfigStorage::class, ClientConfigStorage::class)
54            ->public()
55            ->args(
56                [
57                    service(TokenService::SERVICE_ID),
58                    service(ClientLibRegistry::class),
59                    service(FeatureFlagConfigSwitcher::class),
60                    service(AssetService::SERVICE_ID),
61                    service(common_ext_ExtensionsManager::SERVICE_ID),
62                    service(ClientConfigService::SERVICE_ID),
63                    service(UserLanguageServiceInterface::SERVICE_ID),
64                    service(FeatureFlagRepositoryInterface::class),
65                    service(ResolverFactory::class),
66                    service(LoggerService::SERVICE_ID),
67                    service(SessionService::SERVICE_ID),
68                    service(tao_helpers_Mode::class),
69                    service(DateFormatterFactory::class),
70                    service(MenuService::class),
71                    service(CookiePolicyConfigurationRetriever::class),
72                ]
73            );
74    }
75}