Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 70 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| TranslationServiceProvider | |
0.00% |
0 / 70 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| __invoke | |
0.00% |
0 / 70 |
|
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) 2024 (original work) Open Assessment Technologies SA. |
| 19 | */ |
| 20 | |
| 21 | declare(strict_types=1); |
| 22 | |
| 23 | namespace oat\taoQtiTest\models\Translation\ServiceProvider; |
| 24 | |
| 25 | use oat\generis\model\data\Ontology; |
| 26 | use oat\generis\model\DependencyInjection\ContainerServiceProviderInterface; |
| 27 | use oat\oatbox\log\LoggerService; |
| 28 | use oat\tao\model\TaoOntology; |
| 29 | use oat\tao\model\Translation\Repository\ResourceTranslationRepository; |
| 30 | use oat\tao\model\Translation\Service\ResourceTranslatableStatusRetriever; |
| 31 | use oat\tao\model\Translation\Service\TranslationCreationService; |
| 32 | use oat\tao\model\Translation\Service\TranslationSyncService as TaoTranslationSyncService; |
| 33 | use oat\tao\model\Translation\Service\TranslationUniqueIdSetter; |
| 34 | use oat\taoQtiTest\models\Qti\Identifier\Service\QtiIdentifierSetter; |
| 35 | use oat\taoQtiTest\models\Translation\Service\ResourceTranslatableStatusHandler; |
| 36 | use oat\taoQtiTest\models\Translation\Service\TestTranslator; |
| 37 | use oat\taoQtiTest\models\Translation\Service\TranslationPostCreationService; |
| 38 | use oat\taoQtiTest\models\Translation\Service\TranslationSyncService; |
| 39 | use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; |
| 40 | use taoQtiTest_models_classes_QtiTestService; |
| 41 | |
| 42 | use function Symfony\Component\DependencyInjection\Loader\Configurator\service; |
| 43 | |
| 44 | class TranslationServiceProvider implements ContainerServiceProviderInterface |
| 45 | { |
| 46 | public function __invoke(ContainerConfigurator $configurator): void |
| 47 | { |
| 48 | $services = $configurator->services(); |
| 49 | |
| 50 | $services |
| 51 | ->set(TestTranslator::class, TestTranslator::class) |
| 52 | ->args([ |
| 53 | service(taoQtiTest_models_classes_QtiTestService::class), |
| 54 | service(Ontology::SERVICE_ID), |
| 55 | service(ResourceTranslationRepository::class), |
| 56 | service(LoggerService::SERVICE_ID), |
| 57 | ]); |
| 58 | |
| 59 | $services |
| 60 | ->set(ResourceTranslatableStatusHandler::class, ResourceTranslatableStatusHandler::class) |
| 61 | ->args([ |
| 62 | service(taoQtiTest_models_classes_QtiTestService::class), |
| 63 | service(Ontology::SERVICE_ID), |
| 64 | ]); |
| 65 | |
| 66 | $services |
| 67 | ->set(TranslationSyncService::class, TranslationSyncService::class) |
| 68 | ->args([ |
| 69 | service(TestTranslator::class), |
| 70 | service(LoggerService::SERVICE_ID), |
| 71 | ]); |
| 72 | |
| 73 | $services |
| 74 | ->get(TaoTranslationSyncService::class) |
| 75 | ->call( |
| 76 | 'addSynchronizer', |
| 77 | [ |
| 78 | TaoOntology::CLASS_URI_TEST, |
| 79 | service(TranslationSyncService::class), |
| 80 | ] |
| 81 | ); |
| 82 | |
| 83 | $services |
| 84 | ->set(TranslationPostCreationService::class, TranslationPostCreationService::class) |
| 85 | ->args([ |
| 86 | service(TestTranslator::class), |
| 87 | service(LoggerService::SERVICE_ID), |
| 88 | ]); |
| 89 | |
| 90 | $services |
| 91 | ->get(TranslationUniqueIdSetter::class) |
| 92 | ->call( |
| 93 | 'addQtiIdentifierSetter', |
| 94 | [ |
| 95 | service(QtiIdentifierSetter::class), |
| 96 | TaoOntology::CLASS_URI_TEST, |
| 97 | ] |
| 98 | ); |
| 99 | |
| 100 | $services |
| 101 | ->get(TranslationCreationService::class) |
| 102 | ->call( |
| 103 | 'addPostCreation', |
| 104 | [ |
| 105 | TaoOntology::CLASS_URI_TEST, |
| 106 | service(TranslationPostCreationService::class) |
| 107 | ] |
| 108 | ) |
| 109 | ->call( |
| 110 | 'addPostCreation', |
| 111 | [ |
| 112 | TaoOntology::CLASS_URI_TEST, |
| 113 | service(TranslationUniqueIdSetter::class), |
| 114 | ] |
| 115 | ); |
| 116 | |
| 117 | $services |
| 118 | ->get(ResourceTranslatableStatusRetriever::class) |
| 119 | ->call( |
| 120 | 'addCallable', |
| 121 | [ |
| 122 | TaoOntology::CLASS_URI_TEST, |
| 123 | service(ResourceTranslatableStatusHandler::class) |
| 124 | ] |
| 125 | ); |
| 126 | } |
| 127 | } |