Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 28
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
ResourcesServiceProvider
0.00% covered (danger)
0.00%
0 / 28
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 / 28
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) 2021-2022 (original work) Open Assessment Technologies SA.
19 */
20
21declare(strict_types=1);
22
23namespace oat\tao\model\resources;
24
25use oat\generis\model\data\Ontology;
26use oat\tao\model\resources\relation\service\ResourceRelationServiceProxy;
27use oat\tao\model\resources\Service\ClassDeleter;
28use oat\tao\model\accessControl\PermissionChecker;
29use oat\generis\model\resource\Repository\ClassRepository;
30use oat\tao\model\resources\Service\RootClassesListService;
31use oat\generis\model\resource\Repository\ResourceRepository;
32use oat\tao\model\resources\Specification\RootClassSpecification;
33use oat\generis\model\DependencyInjection\ContainerServiceProviderInterface;
34use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
35
36use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
37
38class ResourcesServiceProvider implements ContainerServiceProviderInterface
39{
40    public function __invoke(ContainerConfigurator $configurator): void
41    {
42        $services = $configurator->services();
43
44        $services
45            ->set(RootClassesListService::class, RootClassesListService::class)
46            ->args(
47                [
48                    service(Ontology::SERVICE_ID),
49                ]
50            );
51
52        $services
53            ->set(RootClassSpecification::class, RootClassSpecification::class)
54            ->args(
55                [
56                    service(RootClassesListService::class),
57                ]
58            );
59
60        $services
61            ->set(ClassDeleter::class, ClassDeleter::class)
62            ->public()
63            ->args(
64                [
65                    service(RootClassSpecification::class),
66                    service(PermissionChecker::class),
67                    service(Ontology::SERVICE_ID),
68                    service(ResourceRepository::class),
69                    service(ClassRepository::class),
70                    service(ResourceRelationServiceProxy::SERVICE_ID)
71                ]
72            );
73    }
74}