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