Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
FormDataProviderServiceProvider
n/a
0 / 0
n/a
0 / 0
1
n/a
0 / 0
 __invoke
n/a
0 / 0
n/a
0 / 0
1
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 (under the project TAO-PRODUCT);
19 *
20 */
21
22declare(strict_types=1);
23
24namespace oat\tao\model\form\DataProvider;
25
26use oat\generis\model\data\Ontology;
27use oat\generis\model\DependencyInjection\ContainerServiceProviderInterface;
28use oat\generis\model\kernel\persistence\DataProvider\form\FormDTOProviderInterface;
29use oat\generis\model\kernel\persistence\starsql\DataProvider\form\FormDTOProvider;
30use oat\generis\model\kernel\persistence\starsql\LanguageProcessor;
31use oat\oatbox\user\UserLanguageServiceInterface;
32use oat\tao\model\Language\Business\Specification\LanguageClassSpecification;
33use oat\tao\model\Language\Filter\LanguageAllowedFilter;
34use oat\tao\model\Language\Service\LanguageListElementSortService;
35use oat\tao\model\Lists\Business\Service\ValueCollectionService;
36use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
37
38use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
39
40/**
41 * @codeCoverageIgnore
42 */
43class FormDataProviderServiceProvider implements ContainerServiceProviderInterface
44{
45    public function __invoke(ContainerConfigurator $configurator): void
46    {
47        $services = $configurator->services();
48
49        $services->set(FormDTOProviderInterface::class, FormDTOProvider::class)
50            ->public()
51            ->args(
52                [
53                    service(Ontology::SERVICE_ID),
54                    service(LanguageProcessor::class),
55                    service(UserLanguageServiceInterface::SERVICE_ID),
56                ]
57            );
58
59        $services->set(BulkFormDataProvider::class, BulkFormDataProvider::class)
60            ->public()
61            ->args(
62                [
63                    service(Ontology::SERVICE_ID),
64                    service(FormDTOProviderInterface::class),
65                ]
66            );
67
68        $services->set(OntologyFormDataProvider::class, OntologyFormDataProvider::class)
69            ->public()
70            ->args(
71                [
72                    service(LanguageClassSpecification::class),
73                    service(LanguageListElementSortService::class),
74                    service(ValueCollectionService::class),
75                    service(LanguageAllowedFilter::class),
76                ]
77            );
78
79        $services->set(ProxyFormDataProvider::class, ProxyFormDataProvider::class)
80            ->public()
81            ->args(
82                [
83                    service(Ontology::SERVICE_ID),
84                    service(BulkFormDataProvider::class),
85                    service(OntologyFormDataProvider::class),
86                ]
87            );
88    }
89}