You've already forked redmine-bundle
43 lines
1.3 KiB
PHP
43 lines
1.3 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace Magdev\RedmineBundle\DependencyInjection;
|
||
|
|
|
||
|
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @author Marco Grätsch <magdev3.0@gmail.com>
|
||
|
|
*/
|
||
|
|
final class Configuration implements ConfigurationInterface
|
||
|
|
{
|
||
|
|
public function getConfigTreeBuilder(): TreeBuilder
|
||
|
|
{
|
||
|
|
$treeBuilder = new TreeBuilder('magdev_gitea');
|
||
|
|
$rootNode = $treeBuilder->getRootNode();
|
||
|
|
$rootNode->fixXmlConfig('connection')
|
||
|
|
->children()
|
||
|
|
->arrayNode('connections')
|
||
|
|
->useAttributeAsKey('name')
|
||
|
|
->normalizeKeys(false)
|
||
|
|
->arrayPrototype()
|
||
|
|
->children()
|
||
|
|
->scalarNode('baseurl')
|
||
|
|
->isRequired()
|
||
|
|
->info('The base URL of the gitea instance')
|
||
|
|
->end()
|
||
|
|
->scalarNode('token')
|
||
|
|
->isRequired()
|
||
|
|
->info('The Gitea access token')
|
||
|
|
->end()
|
||
|
|
->end()
|
||
|
|
->end()
|
||
|
|
->end()
|
||
|
|
->scalarNode('default_connection')->end()
|
||
|
|
;
|
||
|
|
|
||
|
|
return $treeBuilder;
|
||
|
|
}
|
||
|
|
}
|