Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 29 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| IdentifierGenerationStrategyServiceProvider | |
0.00% |
0 / 29 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| __invoke | |
0.00% |
0 / 29 |
|
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\taoQtiItem\model\qti\ServiceProvider; |
| 24 | |
| 25 | use oat\generis\model\DependencyInjection\ContainerServiceProviderInterface; |
| 26 | use oat\tao\model\featureFlag\FeatureFlagChecker; |
| 27 | use common_ext_ExtensionsManager as ExtensionsManager; |
| 28 | use oat\tao\model\IdentifierGenerator\Generator\IdentifierGeneratorProxy; |
| 29 | use oat\tao\model\IdentifierGenerator\Generator\NumericIdentifierGenerator; |
| 30 | use oat\tao\model\TaoOntology; |
| 31 | use oat\taoQtiItem\helpers\QtiXmlLoader; |
| 32 | use oat\taoQtiItem\model\qti\identifierGenerator\QtiIdentifierGenerator; |
| 33 | use oat\taoQtiItem\model\qti\parser\UniqueNumericQtiIdentifierReplacer; |
| 34 | use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; |
| 35 | |
| 36 | use function Symfony\Component\DependencyInjection\Loader\Configurator\service; |
| 37 | |
| 38 | class IdentifierGenerationStrategyServiceProvider implements ContainerServiceProviderInterface |
| 39 | { |
| 40 | public function __invoke(ContainerConfigurator $configurator): void |
| 41 | { |
| 42 | $services = $configurator->services(); |
| 43 | |
| 44 | $services |
| 45 | ->set(QtiXmlLoader::class, QtiXmlLoader::class) |
| 46 | ->args([ |
| 47 | service(ExtensionsManager::SERVICE_ID) |
| 48 | ]); |
| 49 | |
| 50 | $services |
| 51 | ->set(QtiIdentifierGenerator::class, QtiIdentifierGenerator::class) |
| 52 | ->args([ |
| 53 | service(FeatureFlagChecker::class), |
| 54 | service(NumericIdentifierGenerator::class), |
| 55 | ]); |
| 56 | |
| 57 | $services |
| 58 | ->get(IdentifierGeneratorProxy::class) |
| 59 | ->call( |
| 60 | 'addIdentifierGenerator', |
| 61 | [ |
| 62 | service(QtiIdentifierGenerator::class), |
| 63 | TaoOntology::CLASS_URI_ITEM, |
| 64 | ] |
| 65 | ); |
| 66 | |
| 67 | $services |
| 68 | ->set(UniqueNumericQtiIdentifierReplacer::class, UniqueNumericQtiIdentifierReplacer::class) |
| 69 | ->args([ |
| 70 | service(FeatureFlagChecker::class), |
| 71 | service(QtiXmlLoader::class), |
| 72 | service(NumericIdentifierGenerator::class) |
| 73 | ]) |
| 74 | ->public(); |
| 75 | } |
| 76 | } |