tikiwiki/packages/tiki-pkg-tikimanager/symfony/dependency-injection/Tests/Fixtures/includes/ProjectExtension.php

47 lines
1.2 KiB
PHP
Raw Normal View History

2023-11-20 21:52:04 +01:00
<?php
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
class ProjectExtension implements ExtensionInterface
{
public function load(array $configs, ContainerBuilder $configuration)
{
$configuration->setParameter('project.configs', $configs);
$configs = array_filter($configs);
if ($configs) {
$config = array_merge(...$configs);
} else {
$config = [];
}
$configuration->register('project.service.bar', 'FooClass')->setPublic(true);
$configuration->setParameter('project.parameter.bar', $config['foo'] ?? 'foobar');
$configuration->register('project.service.foo', 'FooClass')->setPublic(true);
$configuration->setParameter('project.parameter.foo', $config['foo'] ?? 'foobar');
return $configuration;
}
public function getXsdValidationBasePath()
{
return false;
}
public function getNamespace(): string
{
return 'http://www.example.com/schema/project';
}
public function getAlias(): string
{
return 'project';
}
public function getConfiguration(array $config, ContainerBuilder $container)
{
}
}